Indirect formula for Google Sheets - 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.

Related

Google Sheet Conditional Formatting Based on Date

So I want to have a cell change red if the date in that cell is 2 months from todays date. (contract end date is 17th July, 1 month from now, cell is red)
I have put:
=Today() in cell Y3
=($Y$3-$B3) in cell Z3 and dragged it down, as all dates are different
And then in Column B:B where the dates are I condition formatted - custom formula is and put =AND(($Z3>0), ($Z3<60))
Not working :(
You can just use conditional formatting on the columnB:B.
Set the custom formula to:
=AND(B1 <> "", ROW(B1) >= 3, EDATE(TODAY(), 2) > B1)
ROW(B1) >= 3 - assuming your data starts from the 3rd row.

Obtain first date in column after reference date

In cell B1, I have =today() for today's date and then in the cells below (B2:B100), What I'm trying to do is to compare the date in cell B1 (today's date) and to find the next date that appear in cells B2:B100 AFTER this date and then copy this into A2.
So, in effect, in cell A2, I want a function to look up the next date in cells B2:B100 that is the nearest one AFTER B1 and then copy this into A2. I know this is a formula to add in A2 but just unsure what formula to use.
I've tried this in cell A2,
=MIN(IF(B2:B100>B1, B2:B100))
but it didn't work.
"Other things being equal", the formula is correct but should be entered in the array version (eg with Ctrl+Shift+Enter):
=ArrayFormula(MIN(IF(B2:B100>today(),B2:B100)))
Building the function from B1 into the formula is optional.

Conditional formatting based on if/then on multiple fields

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.

Colour a cell based on the length of time between that date cell and another date cell

This query is in relation to Google Sheets.
If the date in B1 is 10 days older than the date in A1, then B1 is shaded red.
If the date in B1 is within 10 days of the date in A1, then B1 is shaded green.
Does anyone know how I can do this please?
We hope to use this as follows:
Record the date we submit a product.
Record a date to show we have detailed the product as suitable.
(We want this to be within 10 days of us initially submitting the product.)
Therefore we submit a product on the date in A1
We then detail the product as suitable and record this date in B1.
If we have done this within 10 days, B1 should be green. If not, it should be red. This will help us deal with delays.
Does anyone know how I can do this within Google Sheets please?
You have to use Format > Conditional Formatting for the column B, defining the range from the second row:
B2:B1000
You have to set the range this way because the formula is always evaluating in its top left corner first. So you can get the past date from row 1 and formatting the cell in row 2.
You should format your cells with custom formula like:
=DATEDIF(A1,A2,"D")>10
Your B column by default can be green.
You can check my demo sheet for this problem here.
DATEDIF:
https://support.google.com/docs/answer/6055612?hl=en
Conditional Formatting:
https://support.google.com/docs/answer/78413

google spreadsheets: Compare date with dates in a cell range

I have a date in cell B1 and list of Dates in A1:A100.
I would like to get for B1 the cell in A1:A100 where the date has the smallest difference in time.
As you can see in the example, the closest Date to B1 from A1:A100 is in cell A2.
A B C
1 15.4.2011 03.3.2011 A2
2 01.3.2011
3 11.7.2011
4 09.2.2011
To get the dates which are nearest to the date in cell B1, try the following formula in some free cell:
=arrayformula(filter(A:A,abs(A:A-B1)=min(abs(A:A-B1))))
And to get the row number in which the nearest date is, try the following formula:
=arrayformula(match(filter(A:A,abs(A:A-B1)=min(abs(A:A-B1))),A:A,0))
And finally try the following formula for your desired result:
=arrayformula(address(match(filter(A:A,abs(A:A-B1)=min(abs(A:A-B1))),A:A,0),1,4,true))

Resources