Instead of a bunch of nested IF statements...

StuartM1

Board Regular
Joined
Oct 6, 2010
Messages
111
Hi all,

What’s the best way to test each row in a large dataset tosee if it meets three criteria?
If cell A2 is “Blue” and the Expiration Date in B2 is 5/17/18, and C2 is a number, I need cell D2 to multiply the number in C2 by .3 per the table below.

And so on and so on for each row.

What’s the correct way to do this without having a huge combinationof IF statements?


Here’s a copy of the table with test criteria.

Color CodeExpires afterExpires beforeDiscountMultiplier
Blue12/31/20008/15/20181000.1
Blue12/31/20006/30/20181000.3
Red12/31/20006/30/20181000.2
Red12/31/20006/30/20181000.25
<colgroup><col width="88" style="width: 66pt; mso-width-source: userset; mso-width-alt: 3218;"> <col width="109" style="width: 82pt; mso-width-source: userset; mso-width-alt: 3986;"> <col width="129" style="width: 97pt; mso-width-source: userset; mso-width-alt: 4717;"> <col width="86" style="width: 65pt; mso-width-source: userset; mso-width-alt: 3145;" span="2"> <tbody> </tbody>





Any ideas would be appreciated!!
Thanks!!!
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Maybe this is a better visual:

ColorExpiresNumberProduct
Blue5/17/2018600Multiply 600 * .3 from table below
Color CodeExpires afterExpires beforeMultiplier
Blue12/31/20008/15/20180.1
Blue12/31/20006/30/20180.3
Red12/31/20006/30/20180.2
Red12/31/20006/30/20180.25

<tbody>
</tbody>
 
Upvote 0
Thanks for the clarification...


Book1
ABCD
1ColorExpiresNumberProduct
2Blue5/17/201860060
3
4
5
6
7
8Color CodeExpires afterExpires beforeMultiplier
9Blue12/31/20008/15/20180.1
10Blue12/31/20006/30/20180.3
11Red12/31/20006/30/20180.2
12Red12/31/20006/30/20180.25
Sheet1


In D2 control+shift+enter, not just enter:

=IFERROR(INDEX($D$9:$D$12,MATCH(A2,IF(B2>=$B$9:$B$12,IF(B2<=$C$9:$C$12,$A$9:$A$12)),0))*C2,"not available")
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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