Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reference Cell with multiple words and put underscore in between

Status
Not open for further replies.

telecomadmin12

Technical User
Apr 27, 2012
406
DE
My content in a cell is one, two or three words, separated by space.
I want to reference the content in another cell, but put a underscore between the words, add the content from another cell and add some text.

This is what I have in my cells.
[pre] A B[/pre]
1 [box]Michaela[/box] [box] Meier[/box]

2 [box]Tom Rich[/box] [box]Muller[/box]

I want to have in a different cell:
[pre] F [/pre]

1 [box]Michaela_Meier.png[/box]

2 [box]Tom_Rich_Muller.png[/box]

What would be the formula for that?
 
Assuming no other cases to include in output:
=SUBSTITUTE(A1," ","_")&"_"&B1&".png"

combo
 
I'd suggest using the SUBSTITUTE() function on both references, if you might have a Van Winkel, for instance.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Thank you both.
And Skip is right, I do have a Van Winkel, how did you know?

How would the formula look then, if I want to substitute all spaces with "_" in the second cell too?
 
How do I know? I don't give a RIP!

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Instead of pure B1 in the second part of formula use SUBSTITUTE, as in first part, but with B1 as argument.

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top