COUNTIF "text" or "text" with and index match

VKM

New Member
Joined
Jan 5, 2021
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I'm struggling to combine two formulas. What I am trying to do is COUNT the number times 'text_1' and 'text_2' appears in a column IF cell_a MATCH cell_b; however, the column reference for the INDEX needs to be based off another cell.

This COUNTIF INDEX MATCH works a treat:
=COUNTIFS(INDEX(PASTE!A:J,0,MATCH('RR%'!N6,PASTE!$A$1:$J$1,0)),'RR%'!K6)

And the following formula works, but I have to manually edit the column reference by filtering by working out which column needs to be referenced:
=SUM(COUNTIFS(PASTE!$B:B,K6,PASTE!$W:$W,{"Completed (31)","Completed after break (32)"}))

I somehow need to combine these to follow this logic:
  1. If text in cell_a equals column header, use this column, AND
  2. If contents of the cells in the column identified above equals cell_b, THEN
  3. Count the number of times 'text_1' and 'text_2' appears in another column
Any help would be massively appreciated.

Tx. V
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Not entirely sure what you want, but maybe
Excel Formula:
=SUM(COUNTIFS(INDEX(PASTE!A:J,0,MATCH(N6,PASTE!$A$1:$J$1,0)),K6,PASTE!$W:$W,{"Completed (31)","Completed after break (32)"}))
 
  • Like
Reactions: VKM
Upvote 0
Solution
Not entirely sure what you want, but maybe
Excel Formula:
=SUM(COUNTIFS(INDEX(PASTE!A:J,0,MATCH(N6,PASTE!$A$1:$J$1,0)),K6,PASTE!$W:$W,{"Completed (31)","Completed after break (32)"}))
Hi @Fluff - you absolute legend! ?

This works perfectly. I Just couldn't get my head around the structure without returning a formula error. Your solution has helped educate me as I will be using this a lot.

Thanks so much!
V
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,875
Messages
6,122,044
Members
449,063
Latest member
ak94

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