New question: Show contents of Cell if text is entered if not ignore

N

Notts_Lad

Hi Guys,

I know some of you very kindly helped me with my previous questio
tonite which was How do I show the contents of cell A1 & B1 in cell C
and I thank you again for that...... You guys rock

But...

My boss has thrown an addition at me and its way over my head so her
goes:

I now need to be able to the contents of Cell A1 & B1 in cell D
(seperated by a "-" symbol) but also show the contents of Cell C1 if i
has data in it but ignore it if its empty. For Example:

A1 B1 C1 D1
Text1 Text2 Text3 Text1 - Text2 Text3
Text1 Text2 Text1 - Text2

So far I have the following formula: (as supplied by you guys)
=A1 & "-" & B1 & " " & C1

But its the conditional part I can not do - the part thats "if empt
then ignore" but if has text then include it.

Can anyone help me with this, I promise I will not post anothe
question for at least 6 months - lol

Thank you in advance


Kenn
 
D

Dave Peterson

And you don't want that trailing space if C1 is empty?

I'd do this:

=trim(a1&"-"&b1&" "&c1)
and that'll get rid of leading/trailing/multiple embedded spaces)

or

=a1&"-"&b1&if(c1="",""," "&c1)
 

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