If with 3 conditions and 3 possible answers

iamsacti

New Member
Joined
Mar 7, 2014
Messages
12
Hi, guys
First, excuse me for my english. I hope you guys understand what I mean. I have the following data and conditions:

A1 = 7
B1 = 2
C1 = 9
(the answer would be 7)

A1 = 0
B1 = 5
C1 = 3
(the answer would be 5)

A1 = 0
B1 = 0
C1 = 4
(the answer would be 4)

A1 = 0
B1 = 0
C1 = 0
(the answer would be 0)


if A1 has value other than 0, I want A1 as the answer (regardless if in B1 or C1 have a value or not). If A1= 0, I want B1 as the answer. and if A1 and B1 = 0, I want C1 as the answer. But if A1, B1, and C1 = 0, I want 0 as the answer.

What is the formula for those condition?

Thanks
 
Last edited:

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Hi iamsacti,

Adapting the chosen formula from here, this should do the job:

=IF(SUM($A$1:$A$3)=0,0,INDEX($A$1:$A$3,MATCH(TRUE,INDEX($A$1:$A$3<>0,),0)))

Regards,

Robert
 
Upvote 0
did I miss something....

Code:
=IF(AND(A1=0,B1=0),C1,IF(A1=0,B1,IF(A1<>0,A1,0)))
 
Upvote 0
Would this also work for you?

=IF(A1&B1="00",C1,IF(A1=0,B1,A1))
 
Upvote 0
Hi,

Here's another way, will show any value other than 0 (zero) in order of A1, B1, C1 (including negatives):


Book1
ABCDE
17297
20535
30044
40000
50101
Sheet347
Cell Formulas
RangeFormula
E1=IF(A1,A1,IF(B1,B1,C1))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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