Convert string date from UTC to AEST - google-sheets

I'm importing submissions from a DUDA contact form into google sheets but the time stamp is coming across as a string in the wrong time zone (2020-11-16 23:26:29 UTC). As I can't change the form settings to convert the time zone automatically, is there a formula that I can use to do this every time a new submission is saved to the spreadsheet?

It's not clear from your post where (i.e., in which sheet or column) your incoming data is. However, it is best practice never to add anything to a form-intake sheet. Rather, you should do manipulations in another sheet (even if you wind up hiding that sheet from view afterward), and then reference that conversion sheet elsewhere.
That said, supposing that your form-intake sheet is named "Form Reponses 1" and that your UTC dates are coming in as text into A2:A, you can try this formula in cell 1 of an otherwise empty column in another sheet:
=ArrayFormula({"Header"; IF('Form Reponses 1'!A2:A="",, DATEVALUE(REGEXEXTRACT('Form Reponses 1'!A2:A,"^(.+) ")) + TIMEVALUE(REGEXEXTRACT('Form Reponses 1'!A2:A," (.+) ")) + (10/24) )})
You can replace "Header" with a more meaningful header.
The results will likely come across as numbers in the 40,000 range with an extended decimal amount. This is the raw date/time format. Just set Format > Number for the column to whatever data/time format you prefer.

Related

Return client number for previous month by location

I have an example spreadsheet that contains the following columns: Location, Month, Clients, Previous Month, and Previous Month's Clients.
I need a formula that will fill the Previous Month's Clients column with the previous month's number of clients for that location. The columns are unsorted, as the information comes through when the location owners fill out a form linked to the spreadsheet.
The formula also needs to be able to handle blank cells in the Clients column, as sometimes the location owners don't provide that information.
The attempt that I've made doesn't work for the first two months, but for some reason works for the third month (as shown in the example sheet):
=ARRAYFORMULA(IFNA(VLOOKUP(A3:A, FILTER(A3:D, MATCH(DATEVALUE(D3:D), DATEVALUE(B3:B), 0)), 3, FALSE)))
Hopefully I've explained that somewhat clearly. Let me know if I can clarify anything!
I've added a new sheet ("Erik Help") to your sample spreadsheet.
You don't need the column that listed the previous month.
However, your data was not normalized at all. That is, your Col-B dates, while they look normalized, are actually all different dates within each month/year; you just formatted them to look similar. Then, you were trying to use that "previous month" column, which was text; and text can't compare with dates at all.
Here is the formula I shared in my sheet, cell D1 (after deleting your first row and moving the headers to the new Row 1):
=ArrayFormula({"Previous Month's Clients"; IF(A2:A="",,IFERROR(VLOOKUP(A2:A&EOMONTH(B2:B,-2)+1,{A2:A&EOMONTH(B2:B,-1)+1,C2:C},2,FALSE)))})
This formula will produce the header (which you can change within the formula itself as desired) and all results.
I used the EOMONTH function to normalize "this month" and "last month" dates to all fall on the first day of "this month" or "last month." Then, by concatenating the location with those normalized dates, VLOOKUP can look for an exact string. Where none is found, IFERROR returns null.

Why does a different result show up when filtering a date in google sheets?

I'm very new to programming so I'm not sure how to phrase this but in google sheets, I'm having a problem:
when filtering results using =IFERROR(FILTER('Segment Management'!B:B,'Segment Management'!A:A=B5)), it works perfectly fine with letters and numbers but when there's a date in Segment Management cell B5 it instead of saying the date (in this case 15/3/2020) it outputs "43906". Could I get some help to explain why it says this number instead of the date?
Date is considered as plain number in google sheets that's the reason you get numbers instead of date you can either do either of one
Select the column where you have put formula & in menu Format> Number> and select date formatting
OR
use this formula =ARRAYFORMULA(TEXT(FILTER('Segment Management'!B:B,'Segment Management'!A:A=B5),"DD/MM/YYYY"))

ArrayFormula for Earliest Date in each row

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

Combining date/time and maintaining number formatting

I am using an array formula and IMPORTRANGE to import and combine a date column and time column from another sheet:
=ARRAYFORMULA(IMPORTRANGE(BG1, "FORM-SORT!V:V") & CHAR(10) & (IMPORTRANGE(BG1, "FORM-SORT!W:W")))
The first range is my date column and the second is my time column. The data is importing and combining properly, however neither the date nor time is formatting correctly, they are displaying integer values and will not respond to any number formatting options.
Please try:
=ARRAYFORMULA(text(IMPORTRANGE(BG1,"FORM-SORT!V:V"),"dd-mm-yy")&CHAR(10)&TEXT(IMPORTRANGE(BG1,"FORM-SORT!W:W"),"hh:mm"))

Identify errors between two worksheets

I have two sheets in same workbook. Sheet1 is having the data to be updated and sheet2 is having the data after the update. I want to highlight the errors in Sheet2, with comments beside the cell "E" as Wrong Date Entered. I have tried using VLOOKUP formula but it did not work.
Formula Used: =IFERROR(VLOOKUP(E3,ti,5,FALSE),"Wrong Date Entered")
You could retrieve the date from Sheet1 with a multiple field criteria (using IFERROR to retrieve the new entries) and compare the dates.
      
The formula in SHeet2!F2 is,
=IF(E2=IFERROR(INDEX(Sheet1!$E$2:$E$9,MIN(INDEX(ROW($1:$8)+((Sheet1!$A$2:$A$9<>A2)+(Sheet1!$B$2:$B$9<>B2)+(Sheet1!$C$2:$C$9<>C2)+(Sheet1!$D$2:$D$9<>D2))*1E+99,,))), E2),"", "Wrong Date Entered")
Fill down as necessary. When transcribing for your own purposes, remember that ROW(1:8) is the position within Sheet1!E2:E9, not the actual row on the worksheet.
EDIT:
I opened up the Sheet1 ranges to look at 9999 rows then filtered for the error message and came up with the following.
      
The formula with the larger cell ranges I used was,
=IF(E2=IFERROR(INDEX(Sheet1!$E$2:$E$9999,MIN(INDEX(ROW($1:$9998)+((Sheet1!$A$2:$A$9999<>A2)+(Sheet1!$B$2:$B$9999<>B2)+(Sheet1!$C$2:$C$9999<>C2)+(Sheet1!$D$2:$D$9999<>D2))*1E+99,,))), E2),"", "Wrong Date Entered")
When filling the formula down it did take a few seconds to calculate but I'm only using an older business class laptop so I don't think that the calculation lag was anything completely out of the acceptable range.
You can save both files as pdfs and can compare those files using Acrobat Pro.
Goto View -> Compare Documents..

Resources