Formula to determine attendance within specific timeframe

InevitableFile7566

New Member
Joined
Jan 29, 2025
Messages
2
Office Version
  1. 365
Platform
  1. Windows
  2. Web
I am working on an attendance tracker where I need to calculate for individuals participating in workshops, but during their current term appointment. In order to calculate an attendance rate, I need some help with a COUNTIFS formula (or at least I am pretty sure it would be COUNTIFS) that would count the number of occurrences of "Present" during the latest term dates (or during workshops that occurred on a date equal to or greater than the start date of the highest term — Term 3 for Person A and Term 2 for Person B). Currently what I have in cells K3 and K4 is below, but I can't quite figure out why the formula is returning 0 instead of 4 (Person A) and 2 (Person B).



=COUNTIFS(Table1[@[LEAVE BLANK]:[2022-09-01]],"Present",Table1[[#Headers],[LEAVE BLANK]:[2022-09-01]],">="&LARGE(Table1[@[TERM 1 START]:[TERM 4 END]],2))

attendance formula.png
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Welcome to the Forum!

Excel table column headers are always text - you can't make them numeric. So the problem is that you're comparing dates (numeric) to column headers (text) and not getting matches, even though they look the same.

One way to work around this would be:

=SUM((Table1[@[Leave Blank]:[2022-09-01]]="Present")*IFERROR((--Table1[[#Headers],[Leave Blank]:[2022-09-01]])>=LARGE(Table1[@[Term 1 start]:[Term 4 end]],2),0))
 
Upvote 0
Solution
Welcome to the Forum!

Excel table column headers are always text - you can't make them numeric. So the problem is that you're comparing dates (numeric) to column headers (text) and not getting matches, even though they look the same.

One way to work around this would be:

=SUM((Table1[@[Leave Blank]:[2022-09-01]]="Present")*IFERROR((--Table1[[#Headers],[Leave Blank]:[2022-09-01]])>=LARGE(Table1[@[Term 1 start]:[Term 4 end]],2),0))
Wow, thank you so much, this worked perfectly and is incredibly helpful! I had no idea about the headers always being read as text, so thanks for sharing that info. Many thanks again!
 
Upvote 0

Forum statistics

Threads
1,226,114
Messages
6,189,052
Members
453,522
Latest member
Seeker2025

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top