Count if based on sets of data

derik81

New Member
Joined
Jul 17, 2021
Messages
14
Office Version
  1. 2019
Platform
  1. Windows
Hi I am trying to get a total in column B. The total computation is as follows:
1. Row 1 has the 4 same dates with Set 1 to 4 in row 2.
2. The total is computed if there is at least 3 "Y" for a date.

For the first guy, he has 4 Y in first day and 3 Y in 3rd day so it is 2
for the second guy, he has no dates where he has at least 3 Y so 0
for the last guy, he has 4 Y in first and second day but only 2 in third day. so that total is 2.

Is there a formula that I can use in column B "total" ? Where I could check if there is at least 3 Y in a date and if yes then add 1 and so on.
If you need more explanation please let me know.
Thank you.
Screenshot 2021-11-06 193340.jpg
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Cannot manipulate data in a picture. Please reload your data using XL2BB. See my signature for instructions
 
Upvote 0
Not sure if this will work in xl2019, but try
Excel Formula:
=SUM((COUNTIFS($C$1:$N$1,$C$1:$N$1,C3:N3,"Y")>=3)*0.25)
It will probably need to be confirmed with Ctrl Shift Enter.
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0
You're welcome & thanks for the feedback.
I have one more doubt if you could clear it would be so helpful. What if there is only 3 sets for some dates? Like shown in the photo. Then multiplying with 0.25 won't work.
 

Attachments

  • Screenshot 2021-11-06 193340.jpg
    Screenshot 2021-11-06 193340.jpg
    70.3 KB · Views: 6
Upvote 0
What if there is only 3 sets for some dates? Like shown in the photo. Then multiplying with 0.25 won't work.
No it wont, but you originally said
Row 1 has the 4 same dates with Set 1 to 4 in row 2.
Which is what the formula does.

Will you have instances with only 3 dates?
 
Upvote 0
No it wont, but you originally said

Which is what the formula does.

Will you have instances with only 3 dates?
Yes, I will have instances like that. Do you have a solution for such cases?
 
Upvote 0
Is the criteria still 3 Y? Also could you have 2 sets or maybe 5 sets?
 
Upvote 0

Forum statistics

Threads
1,214,996
Messages
6,122,636
Members
449,092
Latest member
bsb1122

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