Count if multiple criteria with corresponding rows

markdwalls

New Member
Joined
May 15, 2018
Messages
23
Office Version
  1. 365
Platform
  1. Windows
Hi All,

Please see below. I need a formula (in yellow cells) that will return how many times the number is counted as well as the corresponding row returning a "yes". So for example, cell BA3 should be 6. Bit stuck with this one so any help will be appreciated.

Thanks in advance,

Mark
1614259164724.png
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Is it you want

Book4
ARASATAUAVAWAXAYAZBA
1123456Yes11 Yes
212Yes21 Yes
31Yes30 Yes
412345641
Sheet1
Cell Formulas
RangeFormula
BA1:BA4BA1=COUNTIF(AR1:AW1,AZ1)&" "&AX1
 
Upvote 0
If you need BA4 to look for the 2s in column AS, etc, then modify the formula like this:
Excel Formula:
=COUNTIFS(OFFSET($AR$3:$AR$13,0,ROW()-3),AZ3,$AX$3:$AX$13,"Yes")
Which should work as you copy it down (will keep shifting the column to check by 1 as you move down each row).
 
Upvote 0
Hi everyone, thanks for the quick responses! I haven't explained so well. Let me try again.

I have a list of products & the ingredients that go in to those products. The ingredients go in to multiple products. This is spread across the row (as shown below).
I then have columns which show whether these are used in certain areas, with the area as the heading & marked with "yes" or "no".
I need to count the amount of times each ingredient is used in each area.
I'm looking for a formula to go in to the yellow cells (I have entered the data manually for the example).

I'm not sure if I've explained this so well, but thank you to anyone who may be able to help!

1614261392946.png
 
Upvote 0
Hi everyone, thanks for the quick responses! I haven't explained so well. Let me try again.

I have a list of products & the ingredients that go in to those products. The ingredients go in to multiple products. This is spread across the row (as shown below).
I then have columns which show whether these are used in certain areas, with the area as the heading & marked with "yes" or "no".
I need to count the amount of times each ingredient is used in each area.
I'm looking for a formula to go in to the yellow cells (I have entered the data manually for the example).

I'm not sure if I've explained this so well, but thank you to anyone who may be able to help!
You have learned something very important here.
NEVER oversimplify your problem for the sake of posting it here (details are crucial).
Otherwise, you may get solutions that correctly answer the exact question you asked, but do not solve the real problem you have!

As it is, I am unable to modify my replies, which worked for the original question you asked, to work for the new details.
It would be easier if we were working with a normalized set of data (i.e., only one ingredient field, with each ingredient a separate row).
 
Upvote 0
If possible modify your data like below and see if this works add each area before ingredient

Book2
ABCDEFG
1ItemAreaIngredientsIngredientRetail ParkHigh Street
2CHICKEN BURGERRetail ParkMAYONNAISEMAYONNAISE10
3FISH FINGER SANDWICHRetail ParkCHICKEN FILLETCHICKEN FILLET10
4High StreetBURGER BUNBURGER BUN01
5High StreetSALADSALAD01
6Retail ParkGHERKINGHERKIN10
7Retail ParkCOLESLAWCOLESLAW10
8High StreetFISH FINGERSFISH FINGERS01
9High StreetBREADBREAD01
Sheet1
Cell Formulas
RangeFormula
F2:F9F2=COUNTIFS($B$2:$B$50,$F$1,$C$2:$C$50,E2)
G2:G9G2=COUNTIFS($B$2:$B$50,$G$1,$C$2:$C$50,E2)
 
Upvote 0
Thanks for the assist, fluff.
I swear, I tried something like that, but was not able to get it to work right.
Not sure what I was doing wrong. Maybe I had a typo somewhere.
 
Upvote 0

Forum statistics

Threads
1,223,879
Messages
6,175,148
Members
452,615
Latest member
bogeys2birdies

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