Multiple Criteria for equation in one cell

rtroehrig

New Member
Joined
May 2, 2018
Messages
49
Office Version
  1. 365
Platform
  1. Windows
So I am trying to factor in production rates and want to return a percentage based on that rate. The problem is the goal rate varies depending on data in two columns (equipment used, container type).

Column 1 could be:
None
Yes-Deaerator
Yes- RP Filter
Yes- Both

Column 2 could be:
Tote
Fluid Bag
EZ Tote
Drum
Keg
Pail
Can
1 lb Tub

That means there are a possible 24 different IF statements in there. This just feels entirely too cumbersome and I am sure would be hell to debug. Anybody have a better idea?
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Re: There Has to be a Better Way- Multiple Criteria for equation in one cell

Use a table with all combinations listed then just use a VLOOKUP or LOOKUP or INDEX MATCH
 
Upvote 0
Re: There Has to be a Better Way- Multiple Criteria for equation in one cell

Looking back over the raw data, I realize there is a third variable with 4 choices. I'm no longer just horizontal and vertical.
 
Upvote 0
Re: There Has to be a Better Way- Multiple Criteria for equation in one cell

So you now have 128 elements.
You can still use a table, just add an extra column, use copy paste to create the table
Base something on this, I havent created all the elements but you get the idea

Sheet 1, 3 column lookup, data starting in A1, with result from 4th column

Code:
  A B C D
1 A 1 1 1
2 B 1 2 2
3 A 2 1 3
4 B 2 2 5

Sheet2
A1 B
A2 2
A3 2
searching for B 2 2, result should be 5

in Sheet2!B1
=IFERROR(LOOKUP(2,(Sheet1!A$1:A$4=A1)/(Sheet1!B$1:B$4=A2)/(Sheet1!C$1:C$4=A3),(Sheet1!D$1:D$4)), "Not found")
 
Last edited:
Upvote 0
Re: There Has to be a Better Way- Multiple Criteria for equation in one cell

The above formula worked to an extent, but it was still kind of buggy and didn't pull completely correct. However, through this discussion and a talk with a co-worker, we were able to accomplish the task. It took the conversations to make the brain understand how simple this could be once the table was built.

Step 1- Build Table on a new worksheet. Using Copy and Paste, this went fairly quick.
Step 2- Add a column to the left of the value you want to return and run =CONCATENATE(A1,B1,C1) then fill the rest of the column
Step 3- In the column in which you want to display the returned value run =IFERROR(VLOOKUP(TRIM(J2)&TRIM(K2)&TRIM(L2),Table!D:E,2,0),"") of course your J2, K2, L2 would be different depending on your spreadsheet.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,198
Members
452,616
Latest member
intern444

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