adding text within formula which is concatenated

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,595
Office Version
  1. 2021
Platform
  1. Windows
I have the folowing formula that has twxt within the formula


Code:
 =IF(B25-C25>0,"The Net Profit "&MID(B3,9,25)&" has increased by "&TEXT(B25-C25,"R#0,##0"), IF(B25-C25<0,"The Net Profit "&MID(B3,9,25)&" has decreased by "&TEXT(B25-C25,"R(#0,##0)")&" VS"))


I need to amend this to read as follows, but canot get it to work


Code:
 =IF(B25-C25>0,"The Net Profit "&MID(B3,9,25)&" has increased by "&TEXT(B25-C25,"R#0,##0") &" Vs the prior year", IF(B25-C25<0,"The Net Profit "&MID(B3,9,25)&" has decreased by "&TEXT(B25-C25,"R(#0,##0)")&" Vs the prior year"))

It should produce the folllowing for e.g.

The Net Profit YTD for 2018 has increased by R 385,255 VS the Prior year



It would be appreciated if someone could assist me
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Unless I missed it, it looks like it both cases you're not finishing the IF function. I think you're missing the "value if false" argument.

But if the top one worked, and the bottom one doesn't, then maybe not. If the only thing you changed was to add "the Prior year" to a working formula, I can't see any reason it wouldn't work. (which is exactly zero help, I know, but I still don't see the false argument in either of your formulas)

EDIT: that would be the false argument in the second IF function within each formula. The "original" IF function has the false argument, which is in fact the second IF function...which is the one I'm talking about.

Maybe you could just remove the second IF and let that be the false argument of the first IF function...??

It would only matter if you broke dead exactly even (EXACT same profit/loss as last year) in a subsequent year.
 
Last edited:
Upvote 0
Thanks for your input


have now resolved the problem


Code:
 =IF(B25-C25>0,"The Net Profit "&MID(B3,9,25)&" has increased by "&TEXT(B25-C25,"R#0,##0") &" VS the Prior Year","The Net Profit "&MID(B3,9,25)&" has decreased by "&TEXT(B25-C25,"R(#0,##0)")&" Vs the Prior year")
 
Upvote 0
I thought that would work :)

As long as it's noted that, like I said above, if (VERY odd chance, I know) you would have to years with the same profit or loss, it would error out as B25-C25 would be zero, which is neither greater than or less than zero......

BUT, what are the odds eh? lol
 
Upvote 0
Hi,

How about rewriting it this way, it's shorter and covers all three possibilities:


Cell Formulas
RangeFormula
A1="The Net Profit "&MID(B3,9,25)&IF(B25-C25>0,"has increased by ",IF(B25-C25<0,"has decreased by ","is even at "))&TEXT(B25-C25,"R#0,##0") &" Vs the prior year"
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,207
Members
452,618
Latest member
Tam84

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