Obtain first date in column after reference date - google-sheets

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.

Related

SUMIF function adding up time with criteria in another cell (date)

Say I have to sum up the cells in column I if their corresponding cells in column B >= the value in specific cell, E5.
I've tried SUMIF(I9:I12,"<="&E5,B9:B12) and it didn't work. Actually the result is 4307280:00.
Column B is formated to dd-mmm.
E5 cell is formated to dd-mmm.
Column I is formated to [hh]:mm.
result cell is formated to [hh]:mm.
How do you fix it so that the criteria of the SUMIF function involves the value in a specific cell? I'd like to set it this way because I have to add up the hours up to and including a specific date.
Thank You

Conditional formatting on google sheet

I need to format A1 when
B1 is empty and A1 is lower than today
A1 is a date, like a deadline that I will print red if the deadline is not reached. B1 is the cell used to say it was done.
Go to conditional formatting and use the custom formula =and(A1<today(),B1="")
You can set the background color red there too.
EDIT: to extend the formatting down the column but not beyond where you have date, you can do apply to range A:A and amend the formula to =and(isDate(A1),A1<today(),B1="")
Here is a picture

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))

Put time into cell

In Google spreadsheet I would like to put the time HH:mm in a cell A2 if the cell A2 is empty and if another cell A1 has a value greater than zero.
It's possible?
Now I have in A2 =If(A1>0;NOW();"") but A2 is always changing
This is a workaround but in practice may be more convenient than alternatives that may require a script. Please try adjusting your formula to:
=if(A1>0;B1;"")
where B1 is any convenient cell. Then selecting that cell with Ctrl+Shift +;. This should put the current time in B1 (or wherever) but unlike =NOW() it does not update.
Strictly speaking this does not comply with I would like to put the time HH:mm in a cell A2 if the cell A2 is empty - because A2 is the location of the formula, but I hope that is not an issue for you.

Resources