If with 3 criteria

hsandeep

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

ABCDE
Names Result
Michael
John
Simon
James

<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>
[TD="bgcolor: #cacaca, align: center"]1[/TD]

[TD="bgcolor: #cacaca, align: center"]2[/TD]

[TD="align: right"]2000[/TD]
[TD="align: right"]2500[/TD]
[TD="align: right"]2400[/TD]
[TD="align: right"]1[/TD]

[TD="bgcolor: #cacaca, align: center"]3[/TD]

[TD="align: right"]5000[/TD]
[TD="align: right"]4500[/TD]
[TD="align: right"]4500.15[/TD]
[TD="align: right"]1[/TD]

[TD="bgcolor: #cacaca, align: center"]4[/TD]

[TD="align: right"]1500.65[/TD]
[TD="align: right"]14900[/TD]
[TD="align: right"]1500[/TD]
[TD="align: right"]0[/TD]

[TD="bgcolor: #cacaca, align: center"]5[/TD]

[TD="align: right"]1823.55[/TD]
[TD="align: right"]1400.25[/TD]
[TD="align: right"]1400[/TD]
[TD="align: right"]0[/TD]

</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

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
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,222,384
Messages
6,165,669
Members
451,983
Latest member
Raph24

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