I have a spreadsheet containing names and dates. I need to determine the date exactly five years after the earliest date listed for each name.
Here is the data with names/info scrubbed, and the formulas as I have them currently.
The only output I ultimately need is the Renewal Date (minimum date + 5 years). Is there a way to output that data to new rows without having to manually copy the format into column E in each new row?
Also, I'd prefer if it only outputs a Renewal Date if there is a date listed in each column. If a row is missing one (or more) dates, no Renewal Date should exist.
I have absolutely no formal Excel/Sheets training or experience, so any help is sincerely appreciated.
I duplicated the sheet in your shared spreadsheet and entered in cell E1
={"Renewal Date";ARRAYFORMULA(IF(COUNTIF(IF(B2:D<>"", ROW(B2:B)),ROW(B2:B))=3, EDATE(QUERY(TRANSPOSE(QUERY(TRANSPOSE( B2:D) , "Select "&"MIN(Col"&JOIN( ", MIN(Col",FILTER(ROW(A2:A)-1, A2:A<>"")&")"))), "Select Col2", 0),60),))}
See if that works for you?
As you mention, ColumnE is not required and the Renewal Date may be calculated with:
=ArrayFormula(if(count(B2:D2)<>3,"",edate(MIN(B2:D2),60)))
though the Arrayformula above is not achieving anything useful - the formula still has to be copied down (from Row2).
Related
I am trying to build a sleep tracker in Google Sheets (link). The idea is to select a year and a month from a drop-down list in cells A1 and A2, which would then populate columns based on the number of days in that month. I have tried different formulas that I found on stack overflow and elsewhere, but could not get them to work.
In short:
I am looking for a formula that will populate the columns with days of that month and a name of the day in a row bellow.
Looking for a way to summarize the time of sleep at the end of the each day, based on a ticked checkbox.
I am not sure how the year and month selectors should be formatted (as plain number or a date).
Is there a way to automatically insert check-boxes to the days of the month?
This is the formula that I have tried to adjust:
=INDEX({TEXT(SEQUENCE(1; DAY(EOMONTH(A2&"/"&A1;0)); A2&"/"&A1; 1); {"d"; "ddd"}); {"Total"; ""}})
But it returns with "Error In ARRAY_LITERAL, an Array Literal was missing values for one or more rows."
Please note that ";" is used as an argument separator instead of "," (regional settings).
Thank you in advance!
I think that with a very small adaptation and date formatting you'll be able to easily do it. First with your selector in A2, you could set it as actual dates, but format them as mmmm:
Then, repeat the sequence in both rows starting in C2 and C3:
=SEQUENCE(1,DAY(EOMONTH(A2,0)),A2)
But formatting row 3 as ddd:
PS: yes, you can do row 3 with TEXT and INDEX. Choose your preferred one:
=INDEX(TEXT(SEQUENCE(1,DAY(EOMONTH(A2,0)),A2),"dddd"))
UPDATE with TEXT VALUES
Return to your previous A2 dropdown and try this, using MATCH to find the number of the month, and DATE to locate the correct beginning of the month in that year:
For row 2:
=SEQUENCE(1,DAY(EOMONTH(DATE(A1,MATCH(A2,{"January","February","March","April","May","June","July","September","October","November","December"},0),1),0)),
DATE(A1,MATCH(A2,{"January","February","March","April","May","June","July","September","October","November","December"},0),1))
For row 3:
=INDEX(TEXT(SEQUENCE(1,DAY(EOMONTH(DATE(A1,MATCH(A2,{"January","February","March","April","May","June","July","September","October","November","December"},0),1),0)),
DATE(A1,MATCH(A2,{"January","February","March","April","May","June","July","September","October","November","December"},0),1)),"dddd")
)
Is there a way to take a date in one row and auto calculate another date in another column 10 days out?
ex: (column a) 12/11/20 -auto calculate the date 10 days from then
and put in (column d) 12/21/20.
So anytime I enter a date and need the 10 day out date it just auto calculates so I don't have to keep entering the date over and over again.
This is possible by using ARRAYFORMULA().
ARRAYFORMULA enables the display of values returned from an array formula into multiple rows and/or columns and the use of non-array functions with arrays.
Try this: =Arrayformula(TO_DATE(IF(A1:A="","", A1:A+10))).
Example:
Reference
Arrayformula()
I have a sheet called "Orders" in which I add each order, its date and amount.
In a separate sheet, I have a monthly summary table.
I want a cell in the summary table to look at the "Orders" sheet, and if the date (in Orders, row G) falls between Jan 1 and Jan 31, I want the total from Orders, column AE to show in the summary table. I'll do this for each month.
This is what I have so far:
=SUMIF(VLOOKUP(AE4:AE5,'Orders'!G4:G5,">=1-Jan-2021″,G4:G5,”<=31-Jan-2021″),0)
Obviously that isn't right (I'm just playing around and don't really know what I'm doing!), but maybe I'm getting close.
Note that new rows (i.e., orders) will be added to the Orders sheet throughout the year, so I want AE5 and G5 in the formula to update automatically as I add a new row.
Any help much appreciated.
Here's one method, which requires a few more columns but isn't terrible. You could probably shorten this a little, but if you're in a pinch then it works.
In your orders sheet, add two more columns titled "Month" and "Year".
Month Formula (which extracts the numeric month from your date):
Cell C2: =MONTH(B2)
Year Formula (which extracts the numeric year from your date):
Cell D2: =YEAR(B2)
Then in your summary data, you create a SUMIFs formula. Picture below.
Cell K2: =SUMIFS(E:E,C:C,I2,D:D,J2)
If I've not misunderstood your requirement then sumifs (plural) itself can help out,
Conveniently you can have a named range "total" for the column G and "date" for column AE of the orders sheet
If you want to add dates greater than 1st of Dec and less than 5th of Dec then in the cell of the summary sheet you can add
SUMIFS(total,date,">=1/12/20",date,"<5/12/20")
I'm having some problems visualizing what your spreadsheet looks like, but assuming the dates you are checking against are in column G and your totals are in column AE, I think the following would work:
=SUMIFS(AE1:AE1000;G1:G1000;"<="&DATE(2020;1;31);G1:G1000;">="&DATE(2020;1;1))
If I wanted to make this formula to autoexpand as I added more rows to the table, I'd change my data into an actual table, and refer to the ranges by their headers. Or you can just do what I've done here, and set a range that is significantly larger than what you are likely to use and hope you never add any entries outside of it.
Okay, found it! The formula that has worked is
=SUMIFS(Orders!$AE4:$AE5,Orders!$G4:$G5,">=1/1/21",Orders!$G4:$G5,"<=1/31/21")
Thanks for all your help!
I have a sheet that is linked to a google form so when a person submits the form, the information is populated into the sheet automatically with a timestamp, ex.1/17/2020 17:26:16. I'm trying to sum information based on multiple criteria and one is to only pull a full days worth of data but the formula is reading time as well and so I keep yielding 0.
For example, here is some data
1/8/2020 17:38:49 Danny PM Beetlejuice on Broadway 1144
1/8/2020 17:38:49 Danny PM Oklahoma! on Broadway 1181
1/8/2020 17:38:49 Danny PM Oklahoma! on Broadway 1000.5
1/8/2020 12:47:18 Jeff PM To Kill a Mockingbird 1675
1/8/2020 12:48:19 Jeff PM Jagged Little Pill 2390
On another tab I'm trying to calculate how much was spent by each person on this day. This new tab is looking at a persons shift and name to sumifs their spend:
=SUMIFS('Form Responses 1'!$E:$E,'Form Responses 1'!$D:$D,B$5,'Form Responses 1'!$B:$B,$A9,'Form Responses 1'!$C:$C,$B$2)
I don't believe you'll need to know what each piece in this current code means since I just need to add to it for it to read a range of dates and narrow down to one day.
I've tried adding the date range 'Form Responses 1'!$E:$E and having the criterion be the desired date filled in B2 but this is when it is reading for an exact match of the time from the range which is not going to work since I don't want it to read the time. I want to find a solution that won't involve having to manually update the submission data each time.
I've included a sample sheet here so whoever wants to try and tackle this can better see what it is I'm working with. In the review tab I have my current formula not specifying date and next to it the same but trying to specify the date.
Thank you in advance. My brain is a scattered mess so I hope everything makes sense.
If you want all records for the specified day to be included, you must use the >= and <= operators.
Something like this:
=SUMIFS('Form Responses 1'!$E:$E,
'Form Responses 1'!$B:$B, $A6,
'Form Responses 1'!$C:$C, $B$2,
'Form Responses 1'!$A:$A, ">="&$B$1,
'Form Responses 1'!$A:$A, "<="&$B$1+1)
In addition to the accepted correct answer, you could also try the following QUERY formula so you can get everything with just one formula instead of 5.
=IFERROR({QUERY(A:E,"select B, sum(E) where not A='' and C='"&H2&"' group by B label B 'Runner Name', sum(E) 'Total Spend' ",1),
QUERY(A:E,"select sum(E) where not A='' and C='"&H2&"' and todate(A)=date '"&text(H1,"yyyy-mm-dd")&"' group by B label sum(E) 'Totals per day' ",1)},
"No data")
(Please adjust ranges to your needs)
By using todate(A) we extract the date value from a timestamp.
The big advantage of using a single query is that -since you use the data from a form- your results will auto update as new answers come through.
Please feel free to ask if you need further information.
Another query that should work for you i've left on the new MK.Help tab in cell A5.
=ARRAYFORMULA(QUERY({INT('Form Responses 1'!A:A),'Form Responses 1'!B1:E},"select Col2,SUM(Col5) where Col1="&B1&" and Col3='"&B2&"' group by Col2 order by SUM(Col5) desc label SUM(Col5)'Total'"))
Agree with the previous poster that a query is the way to go since it'll autopopulate. Also it allows you to display the table in any order you like. I chose to sort by the total with the highest totals at the top.
I have a datestamp in this format on A2:
18.11.2015 15:37:13
How can I split this into date and time so that I have date in A3 and time in A4?
I want to do this because datestamp does not sort properly as a number.
I found several answers to this question with various answers but none of them worked for me.
Wouldn't a simple split() be enough ? In B2:
=split(A2, " ")
Alternatively, in B2:
={INT(A2), timevalue(A2)}
Make sure to format col B as DATE and col C as TIME and see if that works?
To get the date and time in those cells you can do the following:
A3: =DATE(MID(A2,7,4),MID(A2,4,2),LEFT(A2,2))
A4: =TIMEVALUE(RIGHT(A2,8))
It's essentially extracting the essential parts for year/month/day from the string in A2 to get the needed order for date. The time is already properly formatted and can be used with Timevalue, we just need to extract the substring.
The date and time values can then be formatted in any way you want them.