Conditional Formatting custom formula to apply a red highlight to cell ranges that have 6 consecutive values - conditional-formatting

I am trying to apply a red highlight in a Google Sheets file for cell ranges that have 6 consecutive values. I have tried to apply the conditional formatting via App Scripts but this approach causes conflicts with conditional formatting rules applies directly in the front-end of Google Sheets (the conditional formatting applied directly in the "UI" of Google Sheets will overwrite the one applies from the script).
Therefore, I am looking for help with a custom formula that will allow me to apply the red highlight directly in the front-end to avoid this conflict.
The custom formula should go through every cell in the range(s) and detect cells that contain 6 consecutive values. The ranges that meet this condition should be highlighted red.
In the example below ranges A3:F3 and A5:F5 should be highlighted.
Column A
Column B
Column C
Column D
Column E
Column F
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X

Related

Word VBA: Need to remove frames but maintain formatting

I currently have a word document formatted in columns and rows like such (it is about 100 rows and 6 columns in the real example):
a b c d
1 x x x x
2 x x x x
3 x x x x
4 x x x x
Everything has a separate frame, i.e. there are 24 frames in this example. However, when I remove any frame, the formatting does not remain the same (the text tends to go to the top left of the word document).
The reason this is an issue is because I cannot add to the document by typing due to the 'frame formatting' .
I converted the document from xps to docx.
I tried this VBA code which did remove the frames but did not keep the formatting.
Sub CleanUpExport()
Dim aFrame As Frame
Dim p As Paragraph
Dim l As Single
For Each aFrame In ActiveDocument.Frames
aFrame.RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
l = aFrame.HorizontalPosition
For each p In aFrame.Range.Paragraphs
p.LeftIndent = l
Next p
aFrame.Delete
Next aFrame
End Sub
Any help appreciated.
If you copy the content of the frame before deleting the frame and then paste in the same location, you should get the same formatting as before

Hyperlink a sheet to index page containing $ sign [duplicate]

I am working on Excel report in which I need to pass a link which can take me to a cell referenced.
In below example, I have two sheets on same workbook. Now if I click on cell "A1" on Sheet:1, then it should take me to cell "E1" on Sheet:2.
I know by paste special I can pass hyperlink, but tricky part is data on Sheet:2 is dynamic so I can't go that route.
After looking on Google, I have found out multiple things, so I clubbed them together but it is throwing error "Reference is not valid".
Here is the formula that I've used on cell "A1" on Sheet:1:
=HYPERLINK("[Sample.xlsx]Sheet:2!(ADDRESS(MATCH(""ABC"",BEFORE,0),MATCH(""ABC"",BEFORE,0),1))","ABC")
Here BEFORE is a name range that covers A1 to E1.
Sheet:1
a b c d e
1. abc
Sheet:2
a b c d e
1. x x x x abc
Appreciate your inputs.
=HYPERLINK("[Sample.xlsx]'Sheet2'!" & ADDRESS(1,MATCH("abc",BEFORE,0)),"ABC")
If your sheet name might have spaces then make sure to add the single quotes around the name.

Excel 2013 conditional formatting using a formula

I have a spreadsheet in Excel 2013 with Location in Column A, Material Number in Column B and types or groups of materials sorted by material number in Column I J & K. Other columns contain data that is irrelevant here.
Column B can contain the same material number in multiple cells.
I'm trying to find a simpler way to format font and color of the items in Column B by comparing if the item is located in Column I J or K, or not at all (no formatting in that case).
I was entering an individual conditional rule to compare Column B with the value in cell I3, another rule for I4, another rule for I5 and so on.
This is getting unwieldy due to the number of items now in I J & K.
There has to be a simpler, more elegant way to do this. Conditional formatting using exact match is not letting me select a range of cells for the match value.
I just need to format the text in Column B to Bold and Blue if the number exists in Column I also, or Bold and Red if it exists in Column J or Bold and Green if it exists in Column K.
Set up a conditional formatting rule that uses a formula. The formula can contain a Countif function that counts how many times the value in cell B in the current row is counted in column I. For example, starting in row 2, select B2 and add a formatting rule with the formula
=COUNTIF($I:$I,$B2)
Take care to use the current row number in the formula and don't use a dollar sign $ in front of the row number. Set three rules, one for column I, one for J and another one for K.
You don't need a new set of rules for each row. Just apply the three rules to all the rows required.

Parse Google sheets cell input to place in adjacent cell

How can I set things up in google sheets such that it will take my input in, say cell B2, clean it up and put things in cells C2 and D2?
For example, say I put in cell B2 the string "ts 4 x 4 x 3/8 x 13'-5". I can of course write a script called std_shape that can parse this into the ouput array ["HSS4X4X3/8", "13'-5""] and when I put =std_shape(B2) into the cell C2, I'll get what I want: C2 will contain HSS4X4X3/8 and cell D2 will contain "13'-5"". But how to do this such that column C & D will automatically fill in from any row in B? Using an arrayformula() tends to fill downward on column C.
What would be the most efficient way of going about this? I want to be able to make a list of material in column B and then have columns C & D format my list in the way described. For instance columns C & D would be derived from my B column inputs as below (where I've separated the columns with the "|" symbol):
> B | C | D
> ------------------------+---------------+----------
> TS 4x4x1/4 x 13'-4 | HSS4X4X1/4 | 13'-4"
> L 5 x 3-1/2 x 5/16 x 6' | L5X3-1/2X5/16 | 6'-0"
> PL 1/2 x 8 x 10 | PL1/2X8 | 0'-10"
> W10x12 x 13' | W10X12 | 13'-0"
Columns C & D have standardized what was put into B. Further cells in the spreadsheet will work with these standard texts for vlookups and other calculations. I want to keep B as input though. I also wish to validate the input in B as well. For instance, say the W10x12 above cannot be found in a vlookup, then column C for that row would say something like "W10x12 is not a valid entry".
What I'm saying is that I don't know how to handle ranges in my script. I also would like to know the most efficient way of going about this. After all, for any given row, columns C & D only care about that particular row's B value - I don't want my function tossing arrays around willy nilly. Maybe some sort of "onEdit" type deal that creates columns C & D whenever the B entry is edited for any particular row?
I'm having brain stalls with this since user-defined functions can't touch any other cells except in overflow. There's GOT to be some way to do such a thing as I'm describing here?

Conditional formatting formula to highlight appropriate date in range

I need a formula for conditional formatting that will highlight a date between A2:Z2 which matches a number that I enter into a “Committed Sessions Cell” (A1). In row 2 there are a series of numbers that appear above each date column (1,2.3, etc). For example, if I enter a “3” in cell A1, the date in J3 should match the number 3 above it and be highlighted. The idea here is to provide a quick visual prompt for how many sessions are in a client’s contract.
Note: the sequenced numbers 1,2,3 etc in row 2 appear every 5th column (with nothing in between) but there IS other data in between the dates in row 3. Only the appropriate date should be highlighted.
A B C D E F G H I J K L M
1 3
2 1 2 3
3. 1/2/14 2/3/14 2/15/14
With grateful thanks,
~ Jay
Your example is not consistent. If you have the date every fifth column, the dates should be in columns A,F,K,P, etc. with 4 columns between 2 points.
I came up with the following formula: =AND(A2=$A$1,MOD(COLUMN(A3)-1,5)=0) which is applicable to the entire 3rd row. Create it as follow:
IMPORTANT: Select cell A3 (the reference point for the formula)
Without selecting another cell, highlight the entire row 3
Go to Conditional Formatting -> New rule
Choose "Use a formula to determine which cells to format"
In "Format values where this formula is true", put =AND(A2=$A$1,MOD(COLUMN(A3)-1,5)=0)
Choose the formatting that you want (example: Fill with yellow)
Click OK all the way
NOTES:
To change the location of your Committed Sessions, change $A$1 to another cell. Important to keep the dollar signs
The MOD function is the one that controls every fifth column. If you want the highlight every 4th column (i.e. 3 cells between each point such as A, E, I, etc.), replace the number 5 with the number 4