1 year ago

#389080

test-img

imatworkallday

Count Values Based on Date and Reference Excel Formula or VBA

By no choice of my own, I am required to create a schedule in Excel before I upload (read copy) into the scheduling app that we use. What I need to show is the number a 'p', 's', 'f', etc. days that a person is scheduled for (p1, p2). In the monthly totals at the bottom (this will go to its own sheet later), I want Excel to look at the first column in the monthly totals, see p1, then go up to the schedule and count every 'p', 's', 'f', etc. for the month.

Right now, I have COUNTIFS statements doing that calculation with the range fixed within statement itself. Right now my COUNTIFS statements are probably pretty simple. For the p1 totals I have COUNTIFS(B2:B31,"p"). I have a COUNTIFS for each requirement that I have to manually adjust the range for each month for each person (31 total and increasing). The example attached is the smallest of 4 sheets.

I feel like a VBA do while loop with an if in there would work but my VBA is rusty and with excel its non-existent. If there is a way to do it with formulas, I am open to that too. I have tried a couple of youtubes and looked at the Microsoft docs on VBA as well.

Excel Reference

excel

vba

excel-formula

0 Answers

Your Answer

Accepted video resources