Handling error condition in VLOOKUP, plus …
NOTE: Although this is assigned to MacBook Pro and Numbers for Mac, the “problem” is not specific to a platform; Mac or iPad Pro, it’s the same.
I have a spreadsheet that consists of a Teaching Tracking table (see Attachment #1), with input via a form, and a table that shows a Teaching Calendar with the number of hour worked each day, and the type of client (see attachment #2).
On any given day I can have no clients, one client, or more. There is an entry in the Teaching Tracking table, via the form, for each client, so there can be no entry, one entry, or more entries per day-date in the Teaching Tracking Table.
To populate the the Teaching Calendar table, I am using a VLOOKUP formula; for example, for the start time of a lesson, in the C column of the Teaching Calendar table:
VLOOKUP(A2,Teaching Tracking::Work records::$A:$E,2,FALSE).
Also, in the Teaching Calendar table, in the hours columns I use an IF function to assign a value to the cell, depending on the start/end times of the lesson, and the type of client. (I then use the value in the cell to define conditional formatting in the cell, for the blended text and fill colours.)
IF(F$1≥$C2,IF(F$1<$D2,IF($E2="School",2,1),""),"")
I have two issues that I simply cannot get my head around!
- How do I address the errors that appear in the Teaching Calendar table, when there is no entry in the Teaching Tracking table for a given day (i.e., something like the ISNA function in Excel)?
- How do I address the fact that only the first entry for a given day date is reflected in the Calendar? (See, for example, 20th January, when the first lesson started at 10:00 and lasted for 3 hours, and the second started at 13:00 and lasted for 2 hours. Only the first lesson is reflected in the Calendar.)
Attachment #1 - Teaching Tracking table
Attachment #2 - Teaching Calendar
MacBook Pro 15″, macOS 10.15