how can i cover all this in an If statament

Imran Azam

Board Regular
Joined
Mar 15, 2011
Messages
103
<code>How Can I write an if statement to cover all the below rules?</code>
<code>If A1 = “yes” and B2 = "fast" then “ok”</code>
<code>but if C2 = “yes” and D2 = "pen" then “bright”</code>
<code>but if E2 = “yes” and F2 = yes then “light”</code>
<code>if G2 = “yes” and E2 = No and H2= "below" then“slow”</code>

or do I need a case statement?
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
What the priority order? What do you expect here:


Book1
ABCDEFGHI
1yes
2fastyespenyesyesyesnobelow
Sheet1


WBD
 
Upvote 0
Hi there will only be on occurrence at a time for for example

A B C D E
yes fast false false false ok
false false yes pen false bright

<tbody>
</tbody>
 
Last edited:
Upvote 0

Book1
ABCDEFGHI
2yesfastnopencilnononoaboveok
3noslowyespennononoabovebright
4noslownopencilyesyesnoabovelight
5noslownopencilnonoyesbelowslow
6noslownopencilnononoabove???
Sheet1
Cell Formulas
RangeFormula
I2=IF(AND(A2="yes",B2="fast"),"ok",IF(AND(C2="yes",D2="pen"),"bright",IF(AND(E2="yes",F2="yes"),"light",IF(AND(G2="yes",E2="no",H2="below"),"slow","???"))))


WBD
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,313
Members
452,634
Latest member
cpostell

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