String together formula

detriez

Board Regular
Joined
Sep 13, 2011
Messages
193
Office Version
  1. 365
Platform
  1. Windows
I am trying to concatenate as follows

If F2 is not null, Concatenate F1 (header) and F2 CHAR(10) Else nothing
If G2 is not null, Concatenate G1 (header) and G2 CHAR(!0) Else nothing
If H2 is not null, Concatenate H1 (header) and H2 CHAR(10) Else nothing

This formula works but I can use help to string them together

Code:
=IF(F2<>"",CONCATENATE(F1,F2),"")
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Not sure what you are asking. Are you asking how to string all three of these together, like this?
Code:
=IF(F2<>"",CONCATENATE(F1,F2),"") & IF(G2<>"",CONCATENATE(G1,G2),"") & IF(H2<>"",CONCATENATE(H1,H2),"")
If that is not what you are trying to do, please explain in more detail.
 
Upvote 0
Joe. This is exactly was I was trying to do. I think I kept trying to overcomplicate things.. Thank you for your help
 
Upvote 0
UGH.. Spoke too soon sorry.
This formula only returns I2 if <>"".
I actually need it to return all cells if <>"".
Sorry for not completely testing


Code:
=IF(IF(E2<>"",CONCATENATE($E$1,E2)&CHAR(10),"") & IF(G2<>"",CONCATENATE($G$1,G2)&CHAR(10),"") & IF(H2<>"",CONCATENATE($H$1,H2),"")&I2<>"",CONCATENATE($I$1,I2)&CHAR(10),"")
 
Last edited:
Upvote 0
I am not sure I understand what you are saying, but I think you forgot the IF around the I2 part.
 
Upvote 0
I hope this is little more clear

Column E: Column F: Column G: Column H: Column I:
123 ABC 987 XYZ

Should result in Cell A2=:
Column E: 123
Column G: ABC
Column H: 987
Column I: XYZ

This one fails "There's a problem with this formula"

Code:
=IF(IF(E2<>"",CONCATENATE($E$1,E2)&CHAR(10),"") & IF(G2<>"",CONCATENATE($G$1,G2)&CHAR(10),"") & IF(H2<>"",CONCATENATE($H$1,H2),"")& IF(I2<>"",CONCATENATE($I$1,I2),""))
 
Upvote 0
Why do you have the whole thing wrapped in an IF statement?
I think it should just be (4 separate IF statements concatenated together):
Code:
=IF(E2<>"",CONCATENATE($E$1,E2)&CHAR(10),"") & IF(G2<>"",CONCATENATE($G$1,G2)&CHAR(10),"") & IF(H2<>"",CONCATENATE($H$1,H2),"")& IF(I2<>"",CONCATENATE($I$1,I2),"")
 
Upvote 0
Yup... You're right Joe.. I see that.
NOW , it works as expected.
Thanks!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

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