& to an existing string of formulas

johnny52

Active Member
Joined
Oct 13, 2006
Messages
332
Office Version
  1. 2010
  2. 2007
Platform
  1. Windows
Hey Everybody ,at the end of a long string of formulas, I added the following
&IF(a2>0,"(",b2,")","").......................now if a2<0 I wanted it to return a blank, but I'm still getting the parenthesis ( ) appearing ......I want them gone

Any help would be appreciated
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Yes that what I meant, sorry....tried the formula you posted and got ( ) in the cell when a2<0.....the parenthesis are still there when .I was hoping it would be blank
 
Upvote 0
Yes that what I meant, sorry....tried the formula you posted and got ( ) in the cell when a2<0.....the parenthesis are still there when .I was hoping it would be blank
What exactly is in cell A2?
And what does this formula return?
=LEN(A2)
 
Upvote 0
a2=5 b2=3 now your formula =IF(LEN(A2)>0,"(" & B2 & ")","") in c2......so when ( I meant to say,B2 is blank I get ()
 
Upvote 0
If a2=5 and b2=3, the formula returns (3), as expected.
If a2=5 and b2 is blank, the formula returns (), as expected.
If a2 is blank, and b2=3, the formula returns nothing, as expected.

I am guessing maybe you haven't described the issue clearly to us, and what you want is BOTH a2 and b2 to be greater than 0 to return the parentheses and value in between.
If that is correct, then try:
=IF(AND(a2>0,b2>0),"(" & b2 & ")","")
 
Upvote 0
All the previous formulas work.....the numerical results are fine. I just didn't like seeing this ( ) in the cell

I probably explained my issue incorrectly......sorry for that

This however works great thanks for all the help.
 
Upvote 0
All the previous formulas work.....the numerical results are fine. I just didn't like seeing this ( ) in the cell
So it sounds like you really want to check to make sure that B2 has a value in it too, which is what I added in my last formula.
 
Upvote 0
Yes
I also just noticed that if the cell is blank I can just make it -1 in another column and reference that instead .......if(d2="",-1,a2) that got rid of the blank parenthesis too

I'll stick with your solution it covers the multiple options I need .......THANKS :)
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,575
Members
449,089
Latest member
Motoracer88

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