# NetworkDays with IF functionality

Hi,

I am trying to gather a sum total headcount for each day of the month based off another sheet that has a date range of each users visit. How do i capture the total headcount for each day a user is onsite?

I have been using IF(NETWORKDAYS( START DATE, END DATE, = specific day) and get an incorrect argument error.

=IF(NETWORKDAYS({TA Management Submissions Range 3}, {TA Management Submissions Range 2} = [Month_Breakdown]@row))

Tags:

• ✭✭✭✭✭

@Austin Probst Got it

In that case you'll want to use a COUNTIF function to calculate if the Month Breakdown date falls within the Start and End Dates for the listed users:

`=COUNTIFS([Start Date]:[Start Date], <=Month_Breakdown@row, [End Date]:[End Date], >=Month_Breakdown@row)`

Hope this helps!

If my response was helpful in any way (or answered your question) please be sure to upvote it, mark it as awesome, or mark it as the accepted answer!

I'm always looking to connect with other industry professionals, feel free to connect with me on LinkedIn as well!

• ✭✭✭✭✭

Hey @Austin Probst,

So you might be confused as to what NETWORKDAYS does. It returns a number that is calculated by counting the number of business days between two dates, rather than an actual date. You're actually wanting to count how many people were on site on a specific date (Month_Breakdown), correct?

If my response was helpful in any way (or answered your question) please be sure to upvote it, mark it as awesome, or mark it as the accepted answer!

I'm always looking to connect with other industry professionals, feel free to connect with me on LinkedIn as well!

• edited 04/16/24

@bisaacs Yes that is correct. Is there another formula that would better capture this?

• ✭✭✭✭✭

@Austin Probst Got it

In that case you'll want to use a COUNTIF function to calculate if the Month Breakdown date falls within the Start and End Dates for the listed users:

`=COUNTIFS([Start Date]:[Start Date], <=Month_Breakdown@row, [End Date]:[End Date], >=Month_Breakdown@row)`

Hope this helps!

If my response was helpful in any way (or answered your question) please be sure to upvote it, mark it as awesome, or mark it as the accepted answer!

I'm always looking to connect with other industry professionals, feel free to connect with me on LinkedIn as well!

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!