Count nursing hours only when onsite
For PBJ staffing reports, offsite nursing hours become 0. Other hours stay.
What you'll make

The formula

| Number | Part | What it does | Result so far |
|---|---|---|---|
| 1 | OR(NOT(ISLOGICAL(B8)),NOT(ISLOGICAL(C8))) | Checks that B and C hold TRUE or FALSE. | FALSE |
| 2 | "Review nursing/onsite flags" | The message when a flag isn't TRUE or FALSE. | Not used for row 8 |
| 3 | IF(AND(B8,NOT(C8)),0,A8) | Nursing and not onsite gives 0, else the hours. | 0 |
| 4 | IF( … ) | Shows part 2 if part 1 is TRUE, else part 3. | 0 |
Columns B and C must hold TRUE or FALSE, not yes or no. Roles other than nursing keep their hours.
=IF(OR(NOT(ISLOGICAL(B8)),NOT(ISLOGICAL(C8))),"Review nursing/onsite flags",IF(AND(B8,NOT(C8)),0,A8))How to use it
Yellow bar at the top? Click Enable Editing.
- See it work. The Example tab shows 20 made-up examples with the formula already in.
- Use your own hours. Paste the hours and TRUE or FALSE for nursing role and onsite into the green columns of the Template tab. The counted hours fill in by themselves.
- Move them into your letter. Copy the results. Then use Paste Special and choose Values.
Before you send
Take the nursing role from your own job title list, not from the title's wording. An admin nursing title still counts.
Microsoft's help: Using IF with AND, OR and NOT
OTHER ROUTES YOU MIGHT LIKE

Get decimal hours by six-minute bands
7 hours 33 minutes, six-minute bands → 7.6 hours
Get the template →
Note rejected rows with accepted hours
124.5, 3 rejected → 124.50 accepted hour(s); review 3 rejected row(s)
Get the template →
Subtract the larger meal time from hours
8.5 hours, 0.25 meal, 30-minute minimum → 8 hours
Get the template →
Merge a few test letters before the whole mailing
Whole mailing → records 2 to 4 only
Take this route →