# Multiple IF Statement

#### tlc53

##### Active Member
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

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

#### MAKHDOOMLIAQAT

##### Board Regular
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:")

#### jtakw

##### Well-known Member
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",""))

#### tlc53

##### Active Member
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!

#### jtakw

##### Well-known Member
Re: Multiple IF Statement - Help

You're welcome, thanks for feedback.

Replies
6
Views
966
Replies
1
Views
627
Replies
1
Views
202
Replies
7
Views
405
Replies
0
Views
392

1,195,631
Messages
6,010,783
Members
441,569
Latest member
PeggyLee

### 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.

### Which adblocker are you using?

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

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