If then statement?

JTL9161

Well-known Member
Joined
Aug 29, 2012
Messages
567
Office Version
  1. 365
Platform
  1. Windows
I am looking for a IF statement that will:

In cell A9;Compare Cell D9 with K9 and show the greater number in cell A9
BUT
If D9 & K9 equal each other then compare E9 with L9 with the greater number showing in A9
BUT
If E9 & L9 equal each other then compare F9 & M9 with the greater number showing in A9
IF all 3 numbers equal each other then I need a 0 in cell A9.

Thanks for your assistance
James
 
Last edited:

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
How about
=MAX(D91,K91)

Although it depends on the BUT
 
Last edited:
Upvote 0
=if(sumproduct(--(d9:f9=k9:m9))=3,0,max(lookup(2,1/(k9:m9-d9:f9<>0),d9:f9),lookup(2,1/(k9:m9-d9:f9<>0),k9:m9)))
 
Upvote 0
Try

=IF(D9<>K9,MAX(D9,K9),IF(E9<>L9,MAX(E9,L9),IF(F9<>M9,MAX(F9,M9),0)))

Or

=IF(D9=K9,IF(E9=L9,IF(F9=M9,0,MAX(F9,M9)),MAX(E9,L9)),MAX(D9,K9))
 
Upvote 0

Forum statistics

Threads
1,214,429
Messages
6,119,424
Members
448,896
Latest member
MadMarty

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