I'm looking to do conditional formatting on a sheet, by comparing cell values between them on a same line.
For example (based on the shared screenshot below), I would like to highlight on line 3 the cell B3 (because it's the higher avg price / box compared to F3, J3 and N3). Etc...
Any idea how I can do this?
Thanks for you help! :)
Sample screenshot:
You need to apply the below formula in the conditional formatting window with the range selected as B3:B, F3:F, J3:J, N3:N
=B3=MAX($B3,$F3,$J3,$N3)
Sample Screenshot:
Note: formula in the screenshot is incorrect.
Related
I am working on building a weight loss calculator. I am having problems using conditional formatting in my spread sheet. I am trying to have it green if less than c2, and red if greater than c2 . c2 is performed via a v look up function. I have also tried custom function to no avail. Ideally I would like to break this down as a percentage of c2 and have yellow as well but 1 step at a time. I have tried converting to a value and an int and still it's not working correctly.
Thank you in advance!
Please try the following
Select Custom formula is
Put =F15<C$2
Repeat once more with =F15>C$2
To avoid formatting empty cells use =AND(G14<F$3,G14<>"")
To get the Desired result you should use 2 conditional formatting rules with 2 different formulas, for the same range F11:F
Formula 1 to Highlight the range F11:F the "Calories" column with Green
=ArrayFormula(IF(F11:F="",,F11:F<$C$2))
Formula 2 to Highlight the range F11:F the "Calories" column with Red
=ArrayFormula(IF(F11:F="",,F11:F>$C$2))
Since you didn't provide the sheet i did recreate it from scratch.
Explanation
IF Range F11:F is Empty "" Do nothing ,, if isn't Empty check if F11:F < $C$2 in case of green formula 1 and check F11:F > $C$2 in case of red formula 2 if TRUE Highlight green / red if FALSE do nothing.
ArrayFormula allow the usage of non-array functions with arrays and the ability to show values returned by an array formula over many rows and/or columns.
I have a spreadsheet with a custom formula that changes the colour of different cells based on the value in the dates column. I also frequently have to change the formula based on different times of the month.
I would like the formula to point to a cell eg A1 so that whenever I change the contents of A1, the custom formula itself will change.
Currently the custom conditional formatting formula is =E2>=TODAY() -21
I alternate between this and =AND(E2>DATE(2019,3,23),E2<DATE(2019,4,20))
I've tried to use =INDIRECT(A1) as the formula, with A1 cell content =E2>=TODAY() -21 but this doesn't work. I would really appreciate any tips on how to get this working.
custom formula:
=IF((($A$1="=E2>=TODAY()-21")*(E2>=TODAY()-21))+
(($A$1="=AND(E2>DATE(2019,3,23),E2<DATE(2019,4,20))")*((E2>DATE(2019,3,23))*(E2<DATE(2019,4,20)))),1)
demo spreadsheet
https://docs.google.com/spreadsheets/d/12TsEEj3LQSIOv2m6LRRS6FCLvIkuUo_ECfQvK4gw4d8/edit?usp=sharing
I want to use conditional formatting to count the amount of times a name appears in Column H and make the corresponding name in Column B red if it shows up once and crossed out if it shows up twice.
How can I do this? I used COUNTIF but I don't know how to attach the formatting to a specific name/string in Column B so it just formats the next one on the list (I think).
Any advice or help would be greatly appreciated.
Clear any conditional formatting from ColumnB, select B3 to the end of your range to format and Format, Conditional formatting..., Format cells if... Custom formula is and
=countif(H:H,B3)=2
with strikethrough. Add another rule (same range) with Custom formula is and
=countif(H:H,B3)=1
with red fill and Done.
I have a handy little Google Sheet formula that applies a color given a summed total but I can't get that formula to be relative. I suspect this is either an easy genius fix or currently impossible in Sheets. Any help?
Sorry I can't post images, here's a rough simulation of my table a1 - b4
John Doe | 25%
Martha Roe | 25%
John Doe | 75%
Jane Doe | 25%
In the table above, I'm using Conditional formatting to "Format cells if..custom formula is..." and my formula sums up the values in Column B for John Roe and Martha Roe (Column A) and turns both the name and value cell red if that value exceeds 100%. I use the formula below:
=sum(filter(B$1:$B4,A$1:A$4 = A1)) >= 100%
(Full credit to Spreadsheetpro.net's article for the intro SUMIFS, COUNTIFS, & AVERAGEIFS functions in Google Spreadsheet.)
Unfortunately, when I use this conditional formatting approach and drag that formula to the next cell in the row, it still thinks I mean A1 (not A2); it's just applying that original formula to multiple rows. So right now I need to manually change the formula for each cell. Maddening.
What I'd like to do is have it update relative to what cell it's in. To make it easier, I'd be ok if there was a way to tell it in the formula "use the cell I'm in" (instead of specifying A1).
Is there a way I can fix my current formula so Google knows that A1is relative? OR, barring that
Is there a way to use conditioning formatting with a formula so it knows the use the current cell in the formula?
Thanks!
The trick is to not drag the formula per se, but apply it to the range you require. The formula will be propagated across that range, respecting absolute and relative references as if you were dragging an in-cell spreadsheet formula over a range.
In your case, I think you just need to apply:
=SUM(FILTER($B$1:$B$4,$A$1:$A$4=$A1))>=100%
to the range A1:B4.
It can help conceptualise what is going on by just plugging that formula into a spare spreadsheet cell, and dragging it over a 2x4 range of cells.
I'm trying to have a cell on Sheet A check if it's either > or < the value in a cell on Sheet B, then change its color accordingly. Under the custom formula I use: =A1>("SheetB!A1"), but it doesn't seem to work. I use the color Green for the > and the color Red for the <. Every time the rules are saved it will always display A1 on Sheet A in red.
Is the function wrong? Or is it not possible to have a Conditional Format even search across sheets?
For some reason (I confess I don't really know why) a custom formula in conditional formatting does not directly support cross-sheet references.
But cross-sheet references are supported INDIRECT-ly:
=A1>INDIRECT("SheetB!A1")
or if you want to compare A1:B10 on SheetA with A1:B10 on SheetB, then use:
=A1>INDIRECT("SheetB!A1:B10")
=A1>INDIRECT("SheetB!"&CELL("address",A1))
applied to range A1:B10.
You can do this by referencing the cell and row number in the current sheet, so as you drag-copy that conditional formatting to other rows it will reference the correct cells.
In the below equation I am coloring cells based on the exact same cell in some other sheet named "otherSheetName" in this example. If for example you want to color cell B2 in Sheet2 if the cell B2 in otherSheetName contains the text "I Like Dogs" you would go to cell Sheet2!B2 , click condition formatting, choose equation from the drop down and paste the below equation.
=IF(INDIRECT("otherSheetName!"&ADDRESS(ROW();COLUMN()))="I Like Dogs";1;0)
Comparing strings instead of numbers for a conditional formatting rule, you can use:
=EXACT(A1,(INDIRECT("Sheet2!A1")))
Case sensitive.
There is one trick/bug: if you have conditional formatting in Sheet1 that explicitly references itself (e.g., the formula is Sheet1!$C$2), you can copy the conditional formatting to Sheet2 with Paste special > conditional formatting and it will "work"... as long as you don't touch anything:
if you try to edit the conditional formatting in Sheet2, then you'll get an "Invalid formula" error.
if columns/rows change in Sheet1 such that they affect the conditional formatting (e.g., row/column inserts), this is not reflected in Sheet2 (keep in mind that the indirect trick mentioned by #AdamL will also not reflect column/row updates either, so it's a wash in this respect).
I was able to compare two sheet and highlight the differences on the second sheet using conditional formatting :
=A1<>(INDIRECT("Sheet1!"&Address(Row(),Column(),)))