Multiple IF Statement

tlc53

Active Member
Joined
Jul 26, 2018
Messages
399
Hi there,

Can anyone see where I am going wrong please?

Basically, if N80 is >0 return "Enter Capital Gain XPA Code" if N80 is <0 return "Enter Capital Loss XPA Code"
Once the code is entered, I want the "Enter" to be removed from the description so,
If N80>0 and N84>0 return "Capital Gain XPA Code" if N80<0 and N84>0 return "Capital Loss XPA Code".

Here's a couple of my attempts so far, but they may just confuse you :)


=IF(N80>0,"Enter Capital Gain XPA Code:","Enter Capital Loss XPA Code:"),IF(AND(N80>0,N84>0,),"Capital Gain XPA Code:","Capital Loss XPA Code:")))

=IF(N80>0,"Enter Capital Gain XPA Code:","Enter Capital Loss XPA Code:"),IF(AND(N80>0,N84>0,),"Capital Gain XPA Code:",,)if(and(N80<0,N84<0),"Capital Loss XPA Code:",)))

Thank you!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Re: Multiple IF Statement - Help

us if and at first then use if yoru formula will work

IF(AND(N80>0,N84>0,),"Capital Gain XPA Code:","Capital Loss XPA Code:")),=IF(N80>0,"Enter Capital Gain XPA Code:","Enter Capital Loss XPA Code:")
 
Upvote 0
Re: Multiple IF Statement - Help

Hi,

What if N80 is 0 (zero) ?

Assuming that doesn't happen, try this:

=IF(N84<0,"Enter ","")&IF(N80>0,"Capital Gain XPA Code",IF(N80<0,"Capital Loss XPA Code",""))
 
Upvote 0
Re: Multiple IF Statement - Help

Thanks again jtakw!
Slight amend, =IF(N84=0,"Enter ","")&IF(N80>0,"Capital Gain XPA Code",IF(N80<0,"Capital Loss XPA Code",""))
but it works perfectly now. Thank you! :)
 
Upvote 0
Re: Multiple IF Statement - Help

You're welcome, thanks for feedback.
 
Upvote 0

Forum statistics

Threads
1,223,711
Messages
6,174,025
Members
452,542
Latest member
Bricklin

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