How to write an excel index match formula with varying criteria?

Kelmike

New Member
Joined
Aug 2, 2014
Messages
11
Good day,

I have this workbook with 3 sheets (Data, 1st and 2nd). In Data, i have a table with index match formulas to auto populate the values
of each HBins (1~12). So far it was working for most of the time but then I found out that some search pattern I'm using were changing,
hence, instead of returning the correct value, it just shows 0 since my search string does not match anymore. Is there a way I can make my
formula adapt to this varying search patterns? Im thinking something like an OR function. Would that be possible?

Here are samples of the different search strings for HBIN 1. This is almost the same for the other HBINs, the number just change:

Enter Good Bin Qty
Good Bin 1
Hardbin 1
Hardbin1
HBin1

My current pattern will just match "Enter BIN 1 Quantity" and ENTER BIN 1 QTY", but not "Enter BIN1 Quantity".

Appreciate the help you may extend, thanks a lot in advance.
ScreenHunter_8.jpg


ScreenHunter_9.jpg
 
Sumifs on its own can only check each cell once, so you would be able to check for those with a space or those without, but not both. By using an array for the criteria you can create 2 sumifs formulas in one, then enclosing it in sum adds them together.

It is just a shorter way of writing =SUMIFS('2nd'!$D:$D,'2nd'!$B:$B,"BIN1 Q*")+SUMIFS('2nd'!$D:$D,'2nd'!$B:$B,"BIN 1 Q*")

Personally, I would use this in E6, then fill down so that you don't have to edit each formula manually.

=SUM(SUMIFS('2nd'!$D:$D,'2nd'!$B:$B,"*BIN"&{"",""," "," "}&ROWS(E$6:E6)&{""," ",""," "}&"Q*"))

This will find anything that contains the text "BIN#Q", with and without a space both before and after the bin number without the risk of the bins getting mixed. "Good Bin", "HARDBIN", "HBIN" etc. will all be counted.
 
Upvote 0

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Sumifs on its own can only check each cell once, so you would be able to check for those with a space or those without, but not both. By using an array for the criteria you can create 2 sumifs formulas in one, then enclosing it in sum adds them together.

It is just a shorter way of writing =SUMIFS('2nd'!$D:$D,'2nd'!$B:$B,"BIN1 Q*")+SUMIFS('2nd'!$D:$D,'2nd'!$B:$B,"BIN 1 Q*")

Personally, I would use this in E6, then fill down so that you don't have to edit each formula manually.

=SUM(SUMIFS('2nd'!$D:$D,'2nd'!$B:$B,"*BIN"&{"",""," "," "}&ROWS(E$6:E6)&{""," ",""," "}&"Q*"))

This will find anything that contains the text "BIN#Q", with and without a space both before and after the bin number without the risk of the bins getting mixed. "Good Bin", "HARDBIN", "HBIN" etc. will all be counted.
Hi @jasonb75, thanks a lot for the help and explanation, really appreciate it. have a nice day and pls dont stop helping others like me, thanks again.
 
Upvote 0

Forum statistics

Threads
1,215,045
Messages
6,122,836
Members
449,096
Latest member
Erald

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