Hi,
I am currently using the formula below to select timings from various tables (arranged by day) based on the current date E3 and current time B1.
Using the current time, the formula correctly identifies the next timing event within the relevant day table.
However, the issue I am experiencing is that towards the end of the day (eg 23:59), there may not be any further times for that particular day within the table and the formula will then present #N/A. The next time could be 00:00 but this will of course be within the table for the following day and as such, will not be picked up by the formula until we reach the next day.
As a possible workaround, I was I considering adding another date field which will always display the date for the following day F3.
Is there a way the formula could be modified so that in the event of no further data being found within that table, instead of using WEEKDAY(E3,2), the formula will use (WEEKDAY(F3,2) forcing the formula to pick the next nearest time from the table for the following day?
thanks
I am currently using the formula below to select timings from various tables (arranged by day) based on the current date E3 and current time B1.
Using the current time, the formula correctly identifies the next timing event within the relevant day table.
However, the issue I am experiencing is that towards the end of the day (eg 23:59), there may not be any further times for that particular day within the table and the formula will then present #N/A. The next time could be 00:00 but this will of course be within the table for the following day and as such, will not be picked up by the formula until we reach the next day.
As a possible workaround, I was I considering adding another date field which will always display the date for the following day F3.
Is there a way the formula could be modified so that in the event of no further data being found within that table, instead of using WEEKDAY(E3,2), the formula will use (WEEKDAY(F3,2) forcing the formula to pick the next nearest time from the table for the following day?
Excel Formula:
=IF(WEEKDAY(E3,2)=1,XLOOKUP($E$6+1/86400,data_occ2pad2STP!$C$4:$C$52,data_occ2pad2STP!$C$4:$C$52,"not found",1), IF(WEEKDAY(E3,2)=2,XLOOKUP($E$6+1/86400,data_occ2pad2STP!$I$4:$I$52,data_occ2pad2STP!$I$4:$I$52,"not found",1), IF(WEEKDAY(E3,2)=3,XLOOKUP($E$6+1/86400,data_occ2pad2STP!$O$4:$O$52,data_occ2pad2STP!$O$4:$O$52,"not found",1), IF(WEEKDAY(E3,2)=4,XLOOKUP($E$6+1/86400,data_occ2pad2STP!$U$4:$U$52,data_occ2pad2STP!$U$4:$U$52,"not found",1), IF(WEEKDAY(E3,2)=5,XLOOKUP($E$6+1/86400,data_occ2pad2STP!$AA$4:$AA$52,data_occ2pad2STP!$AA$4:$AA$52,"not found",1), IF(WEEKDAY(E3,2)=6,XLOOKUP($E$6+1/86400,data_occ2pad2STP!$AG$4:$AG$52,data_occ2pad2STP!$AG$4:$AG$52,"not found",1), IF(WEEKDAY(E3,2)=7,XLOOKUP($E$6+1/86400,data_occ2pad2STP!$AM$4:$AM$52,data_occ2pad2STP!$AM$4:$AM$52,"not found",1))))))))
thanks