• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Countif with reference to multiple columns having same name

Status
Not open for further replies.

pattyhsu

New Member
I'm looking to count the number of Marisol's based on the date
For example:
on 8/23: there are 9 Marisol, 5 Cindy, etc.

However, because 8/23 spams across 3 columns, I'm not sure how to structure the formula

Please help, thank you!
 

Attachments

  • Screen Shot 2021-08-24 at 8.11.31 PM.png
    Screen Shot 2021-08-24 at 8.11.31 PM.png
    194.8 KB · Views: 13
If you have XLOOKUP you could look up the first instance of a date and return the entire 'Front' column from the rota. This is repeated looking for the final (unnamed) column and the colon ':' operator combines the two to give the day's rota as a single range.
Code:
= COUNTIFS(
     XLOOKUP(singleDate, date, rota,,, 1):
     XLOOKUP(singleDate, date, rota,,,-1),
  empName)
This allows you to nest the range within a COUNTIFS function to count the occurrences of the given employee on the chosen day.
 
If you have XLOOKUP you could look up the first instance of a date and return the entire 'Front' column from the rota. This is repeated looking for the final (unnamed) column and the colon ':' operator combines the two to give the day's rota as a single range.
Code:
= COUNTIFS(
     XLOOKUP(singleDate, date, rota,,, 1):
     XLOOKUP(singleDate, date, rota,,,-1),
  empName)
This allows you to nest the range within a COUNTIFS function to count the occurrences of the given employee on the chosen day.


Thank you! Is there any way doing it in Google Sheets by any chance? I noticed that XLOOKUP is not available in Google Sheets : /
 
Status
Not open for further replies.
Back
Top