Concatenate & IF Function

H

hunscot

Hello,

I have a cell formula, E2, that concatenates several cells to
establish a file name.

=+$A2&"_"&$B2&"_"&$C2&"_"&$D2&"BPM"&".mp3"

However, if D2, which normally contains a 2 to 3 number entry (120) is
blank, I would like the formula to drop "_"&$D2&"BPM"& from the
resulting file name.

If entry found in D2,

Jazz_Combo_Live_120BPM.mp3

If no entry found in D2,

Jazz_Combo_Live.mp3

What is the best way to solve this? Not sure how to exactly
construct a concatenation with an IF function.

Thank you,
Scott
 
J

JE McGimpsey

I have a cell formula, E2, that concatenates several cells to
establish a file name.

=+$A2&"_"&$B2&"_"&$C2&"_"&$D2&"BPM"&".mp3"

However, if D2, which normally contains a 2 to 3 number entry (120) is
blank, I would like the formula to drop "_"&$D2&"BPM"& from the
resulting file name.

If entry found in D2,

Jazz_Combo_Live_120BPM.mp3

If no entry found in D2,

Jazz_Combo_Live.mp3

What is the best way to solve this? Not sure how to exactly
construct a concatenation with an IF function.

First, your leading + sign is unnecessary in XL.

One way:

=$A2 & "_" & $B2 & "_" & $C2 & IF($D2="", "", "_" & $D2 & "BPM") &
".mp3"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top