Conditional formatting based on if/then on multiple fields - google-sheets

I want the background of a cell to be filled in based on one cell and then based on the number of days in the future, which are in other cells.
Cells A3 and A4 have a Date.
Cells B3 and B4 will have text, either "Active" or "Potential"
Cells A10 to A12 are the number of days based on Active.
Cells A15 to A17 are the number of days based on Potential.
Based on the date in cell A3,​​ I want the format of cell A3 to be either red, yellow or green based on certain criteria.
The first criteria is in Cell B3 which will have either "Active" or "Potential".
If B3 says "Active" and the date ​​in A3 is the same as today, then I want cell A3 to be filled red.
If B3 says "Active" and the date in A3 is the same as tomorrow, then I want cell A3 to be filled yellow.
If B3 says "Active" and the date in A3 is after tomorrow, then I want cell A3 to be filled red.
If B3 says "Potential" and the date ​​in A3 is the same as today, then I want cell A3 to be filled red.
If B3 says "Potential" and the date in A3 is in 15 days or less from today, then I want cell A3 to be filled yellow.
If B3 says "Potential" and the date in A3 is greater than15 days from today, then I want cell A3 to be filled red.
I've been struggling to get this right. Any help would be much appreciated!! I pasted an image of my sheet below.

Your screenshot appears to be Google Sheets. As far as I am aware this type of advanced formatting is not available. I recommend using Excel instead.

Related

How do I conditionally change the colour of a cell in Google sheets, based on the cell before?

I want to colour a cell C5 in Google sheets red, if it is greater than the cell B5 before it. Can I do this for the whole sheet, using conditional formatting?
To be clearer: I want to do this for every column, so e.g. make C7 red if it's greater than B7, make E5 red if it's greater than D5, etc.
use formula on range B5:B
=C5>B5

Indirect formula for Google Sheets

I am trying to learn how to do Conditional Formatting using the Indirect Formula so it will work across two tabs in the same spreadsheet.
I have a Calendar in Sheet1 and I would like the cells on this calendar change colour depending on the values in Sheet2.
My Calendar For January in Sheet1 has the following range:
B8 to H8 1st to 7th
B9 to H9 8th to 14th
B10 to H10 15th to 21st
B11 to H11 22nd to 28th
B12 to D11 29th to 31st
I would like the cells to remain white on the calendar if the cells in Sheet2 are negative and change to yellow if the cells in Sheet2 are Zero and change to red if it's a positive.
The cells in Sheet2 that the Calendar reads are:
I95 to N95 1st to 7th
9P95 to V95 8th to 14th
W95 to AC95 15th to 21st
AD95 to AJ95 22nd to 28th
AK95 to AM95 29th to 31st
So, for example, the Cell in Sheet2 I95 is -1 then the Cell B8 in Sheet1 will remain white, if I95=0 then the cell B8 in Sheet1 will turn Yellow and if greater than 0 B8 in Sheet1 will turn Red.
I assume this can be done using a range rather than have to repeat it 31 times just for January.

Conditional formatting in Google Docs

Struggling like hell with this one but bet it's so simple!
Can do it in Libre but not in Google :-(
What I want to do is:
I have a range of cells with numbers in, ranges B8 to F20 and another set of cells in range B2 to F2
If a number in cell range B8 to F20 is same as one in range B2 to F2 I want to highlight the cell in range B8 to F20
Any help appreciated, I'm pulling my hair out :-)
Try custom formula:
Set custom formula in cell B2
=countif($B8:$F20,B2)
Apply to range B2:F2
Try selecting cells B8:F20 and click Format > Conditional formatting > Custom formula is:
=arrayformula(sum(n(value(B8)=arrayformula(value({$B$2:$F$2})))))

Hide a rows and/or columns using formulas

Is it possible to conditionally hide rows and/or columns using formulas but NOT the API?
Example:
=IF(A1=0,HIDEROW(1),SHOWROW(1))
HIDEROW and SHOWROW are not native Google Spreadsheets functions and with that and using formulas but NOT the API I am not sure what you want, though the answer is likely ‘No’ regardless.
Alternatives may include a Google Apps Script, hiding the row content rather than the row itself (say with conditional formatting) and filtering the data – ie a copy of only the part you want visible. This might be with FILTER. For example with 0 and 1 alternating in A1:A4 of Sheet1 and B1 series filled in B1 to B4 then in A1 of another sheet:
=IF(F1=2,FILTER(Sheet1!B1:B4,NOT(ISBLANK(Sheet1!A1:A4))),FILTER(Sheet1!B1:B4,Sheet1!A1:A4=F1))
Should show B1 … B4 in that other sheet when F1 in that sheet is 2, just B2 and B4 when 1 and just B1 and B3 when 0.

If statement contingent on data from 2 cells

Using Excel 2010 I need a formula that will respond to data in one cell, and differently to data in another.
Cell A1 = Date
Cell A2 = Invoice Dollar Value
Cell A3 = Discount (formula to remove 15% from A2)
Cell A4 = Refund amount
Cell A5 I want to read... if there is a date in A1, then A2 - A3, BUT if there is a value in A4 then A4 - A2 (note, if there is a value in A4, there will not be a value in A2)
I have tried the following...
=IF(A1<>"",(A2-A3),"",If(A4<>"",A4-A3,""))
So my goal is to have the spreadsheet calculate Invoice amount minus any discount. And in the same cell calculate refund amount minus any discount.
Your outer IF statement isn't quite right. The structure is
IF(Condition,<execute this when true>,<execute this when false>). But you're putting 4 parameters into it.
Try =IF(A1<>"",(A2-A3),If(A4<>"",A4-A3,"")) instead.
NB: This only checks that cells A1 & A4 have values, not that they are of a specific type, i.e. it it isn't checking that A1 has a date.

Resources