Hi, What must be formula for, two different d...

Hi, What must be formula for, two different date column in different sheets.

HOUR(sheet1([date1])-(sheet2([date2])/24 is it true? Or what need to be?

0 6 366
6 REPLIES 6

@Etwo_Cargo are you asking this as a Spreadsheet formula or as an AppSheet expression?

@Levent_KULACOGLU Dear Levent, The second one. AppSheet expression.

HOUR( ANY(SELECT(Table1[Date1],{Yes/No})) - ANY(SELECT(Table2[Date2],{Yes/No})) )/24

@Levent_KULACOGLU says SELECT has invalid inputs.

@Etwo_Cargo {Yes/No} part in my example is a conditional expression that will evaluate to true to filter out the data gathered by SELECT. Like: ANY(SELECT(Table1[Date1], [Date1]>=TODAY ()))

HOUR(LOOKUP(KeyVal1, โ€œSheet1โ€, โ€œSheet1KeyColโ€, โ€œSheet1DateColโ€) - LOOKUP(KeyVal2, โ€œSheet2โ€, โ€œSheet2KeyColโ€, โ€œSheet2DateColโ€)) / 24

LOOKUP(โ€ฆ) gets a single value from a specific column of a specific row in a table. Similar to @Levent_KULACOGLUโ€™s ANY(SELECT(โ€ฆ)) expressions.

KeyVal1 and KeyVal2 represent the KEY column values in Sheet1 and Sheet2, respectfully, that uniquely identify the rows that contain the dates you want to compare.

โ€œSheet1โ€ and โ€œSheet2โ€ are the names of the two AppSheet tables.

โ€œSheet1KeyColโ€ is the name of the KEY column in Sheet1 where [KeyVal1] will be found. Likewise for โ€œSheet2KeyColโ€.

โ€œSheet1DateColโ€ is the name of the column in Sheet1 that contains the date you want to use. Likewise for โ€œSheet2DateColโ€.

The expression above is equivalent to:

HOUR(ANY(SELECT(Sheet1[Sheet1DateCol], ([Sheet1KeyCol] = KeyVal1)) - ANY(SELECT(Sheet2[Sheet2DateCol], ([Sheet2KeyCol] = KeyVal2))) / 24

Top Labels in this Space