Countif with index match where multiple columns match

Peteypirate

New Member
Joined
Mar 27, 2015
Messages
6
I have a data matrix which has order information running vertically, and cost options running across the top. If the order has the option then it shows the optionvalue in the corresponding cell, otherwise it is blank.

On a separate tab using the following formula I am able to do a count foreach option, by region, how many times it is spec’d;

=COUNTIFS(INDEX('Cost Option Values'!$6:$1048576,0,MATCH(“OPTIONCODE”,'Cost OptionValues'!$4:$4,0)),"<>"&"",'Cost OptionValues'!$E$6:$E$1048576,”REGION NAME”)
This works perfectly.
However, I now want to change the formula to count groupsof options (all options codes that begin with the same 5 letters).

I know I need to change part of my formula to “OptionCode Prefix”&”*”, but I don’t know how to change the index and match partto count from multiple matching columns.

Any help would be appreciated.

 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
You will not be able to use ranges that big with this or the spreadsheet will struggle to cope but use this and changes ranges to suit data:

=SUMPRODUCT((LEFT($A$4:$Z$4,17)="OPTIONCODE PREFIX")*($A$6:$Z$100<>"")*($E$6:$E$100="REGION NAME"))
 
Upvote 0
Hi, this works but as you said does not work with a range this big. Is there a maximum size of range this would work with?
 
Upvote 0
It will work with what you have but will be very slow. Just put in appropriate ranges not to the end of the sheet. I presume you dont have 1000000 rows of data.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,322
Members
452,635
Latest member
laura12345

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