Is there a way to add the value of one particular cell to that of another particular cell once per day?
e.g. Cell A2 contains a value (which may change). Whatever that value is at midnight, add it to the value of cell B2
Thanks
if your question is how to add +1 to your A2 value every day:
not really, but you can trick it... today's date value is:
so if your A2 it's let's say 20 you can use this in B2:
=A2+VALUE(TODAY())-44580
eg at midnight B2 will become 21 and next day it will be 22, etc.
if your question is how to add A2 to B2 on a daily basis:
it is possible only with script
Related
I have here formula that can easily convert the weekday text like Sunday to weekday int to 1.
=MATCH(A2,{"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"},0)
My question is how to convert array-text to array-int?
Let's say for example in a cell, I have value Sunday, Monday. Do we have a formula for us to get the array for example {1,2}?
About Let's say for example in a cell, I have value Sunday, Monday. Do we have a formula for us to get the array for example {1,2}?, I guessed that from your showing formula is used, you might have wanted 7 and 1. If my understanding is correct, when your sample formula is used, how about the following modification?
Modified formula:
=ARRAYFORMULA(MATCH(TRIM(SPLIT(A1,",")),{"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"},0))
In this case, Sunday, Monday is put in cell "A1".
Testing:
Note:
When the following formula is used,
="{"&TEXTJOIN(",",TRUE,ARRAYFORMULA(MATCH(TRIM(SPLIT(A1,",")),{"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"},0)))&"}"
When Sunday, Monday is put in the cell "A2", {7,1} is put to a cell.
you can also try:
="{"&JOIN(",",INDEX(MATCH(SPLIT(A2,", "),TEXT(SEQUENCE(7,1,2),"DDDD"),0)))&"}"
Often I want to quick fill of a list of time similar to how I put a 1 in A1 and then in A2 I place A1 + 1 to get two and then I copy that down the next 100 cells to get from 1 to 100. I want to do the same thing with time. It also gives me the advantage of change the first cell and updating all the times. I asked this partly because the other answers are more complex and never get to a simple solution for this kind of process that is so often used.
to populate rows with numbers from 1 to 100 use:
=SEQUENCE(100)
to get time intervals use:
=INDEX(TEXT(SEQUENCE(12, 1, 0, 2)*"1:00:00", "hh:mm:ss"))
=INDEX(TEXT(SEQUENCE(
12 +N("number of rows"),
1 +N("number of columns"),
0 +N("start from midnight"),
2 +N("interval of increase"))
*"1:00:00" +N("period of increase"),
"hh:mm:s" &N("time format")))
Working through https://spreadsheetpoint.com/add-time-in-google-sheets/ I came up with:
Make sure the cells you are working with are in the time format you desire.
Place the time you want to start with in the first cell, let's say A1
To add an hour to the time in A1, use =A1+60/(24*60), let's say in A2
Now you can copy A2 down as far in column A you desire to get the time.
Notice, the 60 in the formula =A1+60/(24*60) is the number of minutes. Hence, if you want to do a half-hour, you can use 30.
So I am trying to recreate something like this picture:
Financial Year in excel
But I just found out that the cell B7 does not work, the cell B7 contains the formula:
=IF($A$3="Financial Year",((CONCATENATE(B9,$C$3))-DAY(CONCATENATE(B9,$C$3))+1),EDATE(Summary!$C$15,-11))
In the above A3 cell is the one where I choose Financial Year, B9 is month January, C3 is the cell with the calendar year 2020 and the Summary tab is the picture here:Summary Tab where cell C15 is the starting date with the formula: =EOMONTH(TODAY(),-1)+1
Error I am getting from Cell B7:
Function Day Parameter 1 expects number values. But "January" is a text and cannot be coerced to a number
You may have had a temporary condition where C3 was blank. It is easy to run several tests to see what Day does with "Strings".
=Day("January" & 2020) returns 1, the day value of the first day of January.
=Day("January2020") also returns 1, even though "January2020" is clearly a string.
=Day("Nothing2020") returns the error you saw, where DAY expects a numeric value.
If the string is one that Google Sheets recognises as a date type, it treats it as a number value for those functions requiring that.
"January2020" is seen as a valid date, but "January" is not.
Your error indicates to me that C3 was blank at the time of the error, since it said {
"January" is a text, and cannot.....} .
Let us know if you still have the error situation. If so, please share a copy of your sheet.
I have one date in C4. And I have dates calculated in Column I.
I am trying to highlight with conditional formatting any date in column I that is before the date in C4 and within the next 45 days of today.
Criteria 1: Date in Column I is sooner than date in cell C4
Criteria 2: 45 days or less from today = True
This is the formula I have so far, but can't seem to get working correctly -
=AND(C4>TODAY(), C4-TODAY()<=45)
I can get the formula to work on a single cell as follows:
=AND($C$4>$I$13, $C$4-TODAY()<=45)
I tried to copy down, but that just gets it to apply to the entire the formatting to the entire column
Solution:
=AND(I4<$C$4,ABS(I4-TODAY())<=45)
Was able to apply this range to the whole column and where you see I4, the formula would update to the relative cell. Interesting Note, I had been trying this in 2010 but in reverse (subtracting c4 from today) and was having trouble with the formula not saving without automatically adding absolute cell references.
I'd like to insert time windows repeatedly in a column, like this:
10:00-10:20
10:20-10:40
10:40-11:00
11:00-11:20
11:20-11:40
12:00-12:20
Is there a way to achieve this?
Put data in cells:
B1 = 10:00 (start time)
B2 = 12:20 (end time)
B3 = 20 (interval in minutes)
Here's single arrayFormula, that will generate your column:
=ARRAYFORMULA(TEXT(B1+B3*1/24/60*(row(OFFSET(B8,,,(B2-B1)/(B3*1/24/60)))-row(B7)-1),"HH:MM")&"-"&TEXT(B1+B3*1/24/60*(row(OFFSET(B8,,,(B2-B1)/(B3*1/24/60)))-row(B7)),"HH:MM"))
Explanations
Look at sample file to explore more about this formula. Pay attention on some details:
any kind of logical sequence could be done with help of series 1,2,3... Formula like =ARRAYFORMULA(row(OFFSET(B8,,,7))-row(B7)) gives us column from 1 to 7.
Time treated like numbers in sheets: 1 day is 1, 1 hour is 1/24, 1 minute is 1/24/60 and so on
Time can't be properly converted into text as it's number. So you have to use text(time, "HH:MM") formula to convert time into text.
This will repeat your time window. The formula assumes the time range is in A2:A6.
The 3 in the formula is the number of repeats (change to you need). You might want
to consider placing A2:A6 on another sheet and referencing it in the formula.
=TRANSPOSE(SPLIT(JOIN(",", ARRAYFORMULA(SPLIT(transpose(rept(join(",",A2:A6)&",",3)),",")&",")), ","))