If with 3 criteria

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
1,213
Office Version
  1. 2010
Platform
  1. Windows
  2. Mobile
Sheet1

ABCDE
1Names Result
2Michael2000250024001
3John500045004500.151
4Simon1500.651490015000
5James1823.551400.2514000

<colgroup><col style="FONT-WEIGHT: bold; WIDTH: 30px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"></colgroup><tbody>
</tbody>

if Names is John or James Column E=1 if D>=C else 0.
if Names is OTHER THAN John or James Column E=1 if D>=B else 0.
For error E=null.
What should the formula be in column E?
Thanx in adv.
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Try (untested)

in E2
=IF(OR(AND(OR(A2="John",A2="James"),D2>=C2),AND(AND(A2<>"John",A2<>"James"),D2>=B2)),1,0)
 
Upvote 0
I'm not sure what you want to test for error. I'm sure you can add that.

Would this work?

=IF(OR(A2="James",A2="John"),IF(D2>C2,1,0),IF(D2>B2,1,0))
 
Upvote 0
In E2:

=IF(AND(OR(A2="John",A2="James"),D2>=C2),1,IF(D2>=B2,1,0))


I don't think that this works. If john or james and d2 < c2 and d2 > <c2 but="" d2="">b2 they will get a 1</c2>
 
Upvote 0
@bbott

That will produce 1 if...

AND(A2 < > "John",A2 < > "James") AND D2 < C2 AND D2 > = B2

which may or may not happen
 
Last edited:
Upvote 0
Additionally:
column F=C if Names is John or James else B
How to accomplish?
 
Upvote 0

Forum statistics

Threads
1,213,506
Messages
6,114,024
Members
448,543
Latest member
MartinLarkin

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