My question has 2 parts to it.
I need to check for a missing date in 8 columns (4 sets of Start and End Date) that has a start date or end date, but not the other. I use these columns to calculate vacation days used. So if someone inputs a start date but forgets to put a end date in, I want to show “Start or End Date Missing” instead of the calculation.
This works so far for one start/end column pair.
IF(LEN({Vacation Start 1})>0, IF(LEN({Vacation End 1})=0),“Missing a Start or End Date”, BLANK())
But I am looking to group all 8 columns to one answer like this
IF(LEN({Vacation Start 1})>0, IF(LEN({Vacation End 1})=0,“Missing a Start or End Date”, BLANK()),
IF(LEN({Vacation Start 2})>0, IF(LEN({Vacation End 2})=0,“Missing a Start or End Date”, BLANK()),
IF(LEN({Vacation Start 3})>0, IF(LEN({Vacation End 3})=0,“Missing a Start or End Date”, BLANK()),
IF(LEN({Vacation Start 4})>0, IF(LEN({Vacation End 4})=0,“Missing a Start or End Date”, BLANK()),BLANK()))))
But this just looks at the first IF statement (Vacation Start/End 1). I am guessing that there is a more efficient way to write this too.
I am also looking to see if there is a better way to Sum date columns and in the end, add the date check code above into the same equation.
This SUM code works well for me now, but doesn’t check to see if someone forgot to complete both start and end date
SUM(IF(AND({Vacation Start 1},{Vacation End 1}), DATETIME_DIFF({Vacation End 1},{Vacation Start 1},‘d’),0),
IF(AND({Vacation Start 2},{Vacation End 2}), DATETIME_DIFF({Vacation End 2},{Vacation Start 2},‘d’),0),
IF(AND({Vacation Start 3},{Vacation End 3}), DATETIME_DIFF({Vacation End 3},{Vacation Start 3},‘d’),0),
IF(AND({Vacation Start 4},{Vacation End 4}), DATETIME_DIFF({Vacation End 4},{Vacation Start 4},‘d’),0))
In the end I would like to combine all of this into one.
Thanks in advance