Only do formula if cell contains something

LondonEddie

New Member
Joined
Jun 1, 2011
Messages
4
Hi there,

I've got the following forumla which is working fine, however I want to be able to copy it all the way down the worksheet, but only populate the cell it's in if cell C7 has something in it, i.e. not blank so that it doesn't look untidy, is this possible?

=IFERROR(CONCATENATE(C2,B7,D2,C7),"")

Thanks,
Eddie.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
This?

Code:
=IF(NOT(ISBLANK(C7)),IFERROR(C2 & B7 & D2 & C7,""),"")
 
Upvote 0
Thanks guys, that's great. Now I'm trying to be a bit more clever... The following formula isn't quite working - I'm not sure I'm completing a formula correctly.

This is basically the formula from above, but with an added IF to ensure the contents of the cell has http:// at the start, so if the link in B9 doesn't have this, add it as part of the concatenation, if it already does, then just do the concatenation. That make sense?

=IF(C9="","",IFERROR(IF(ISNUMBER(SEARCH("http://",B9)),CONCATENATE(B9,$B$5,C9),CONCATENATE("http://",B9,$B$5,C9)))

Eddie.
 
Upvote 0
Maybe

=if(c9="","","http://"&substitute(B9,"http://","")&$B$5&C9)
 
Last edited:
Upvote 0
Jason - that works perfectly, thanks. Now I just need to figure out what you did...!!

Wow learning excel is so much fun!!!

Thanks everyone.
 
Upvote 0
I used & in place of concatenate, the formula is a simplified version of

=if(c9="","",CONCATENATE("http://",substitute(B9,"http://",""),$B$5,C9))

Substitute replaces "http://" in B9 with "" before concatenating it with the rest of the string, in effect this is the same as removing the second (if found) occurrence of "http://" from the string while leaving the first in place,

i.e. =IF(C9="","",SUBSTITUTE("http://"&B9&$B$5&C9,"http://","",2))
 
Upvote 0
You could also get rid of the http:// first and then append it, then either way it will work:

=IF(C9="","","http://"&SUBSTITUTE(B9,"http://","")&$B$5&C9)
 
Upvote 0

Forum statistics

Threads
1,224,585
Messages
6,179,706
Members
452,939
Latest member
WCrawford

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