Multiple IF Statement

tlc53

Active Member
Joined
Jul 26, 2018
Messages
392
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
Joined
Jan 14, 2013
Messages
50
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

jtakw

Well-known Member
Joined
Jun 29, 2014
Messages
7,245
Office Version
  1. 2016
Platform
  1. Windows
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

tlc53

Active Member
Joined
Jul 26, 2018
Messages
392
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

jtakw

Well-known Member
Joined
Jun 29, 2014
Messages
7,245
Office Version
  1. 2016
Platform
  1. Windows
Re: Multiple IF Statement - Help

You're welcome, thanks for feedback.
 
Upvote 0

Forum statistics

Threads
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.
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
Top