Spaces

J

jamalhakem

Hi
Anyone can help
I have this problem in this formula
A B C D
1 Olives Chili Cumin
2 12 19 15
=IF(A2<20;$A$1;"")&IF(B2<20;$B$1;"")&IF(C2<20;$C$1;"")
What I get is Oiveschilicumin without spaces in between, how to have
the spaces in this formula
Thanks in advance
Jam
 
N

Niek Otten

Hi Jam,

=IF(A2<20;$A$1;"")&" "&IF(B2<20;$B$1;"")&" "&IF(C2<20;$C$1;"")

--
Kind regards,

Niek Otten
Microsoft MVP - Excel


| Hi
| Anyone can help
| I have this problem in this formula
| A B C D
| 1 Olives Chili Cumin
| 2 12 19 15
| =IF(A2<20;$A$1;"")&IF(B2<20;$B$1;"")&IF(C2<20;$C$1;"")
| What I get is Oiveschilicumin without spaces in between, how to have
| the spaces in this formula
| Thanks in advance
| Jam
|
 
D

Dave Peterson

Maybe...

=trim(a1&" "&b1&" "&c1)



Hi
Anyone can help
I have this problem in this formula
A B C D
1 Olives Chili Cumin
2 12 19 15
=IF(A2<20;$A$1;"")&IF(B2<20;$B$1;"")&IF(C2<20;$C$1;"")
What I get is Oiveschilicumin without spaces in between, how to have
the spaces in this formula
Thanks in advance
Jam
 
D

David Biddulph

Because in your formula you are putting a space in place of the empty string
when the row 2 value is >=20, but what the OP was asking for was a space
between his $A$1,$B$1, and $C$1 results when the row 2 value is <20.
As you say, if row 1 includes either leading or trailing spaces, then the
change isn't needed, but text strings with leading or particularly trailing
spaces often cause confusion elsewhere.
 
Top