Problems appending cells together

  • Thread starter Thread starter ChrisL
  • Start date Start date
C

ChrisL

I have what I hope will be a nice easy question for you guys... :)

I'm putting together a worksheet for our local sports league. I want to
append the scores from two cells together with a - in between them (e.g.
2-1), which works fine unless the 2nd score is a zero, in which case it
ignores the - (e.g. 20). How can I get it to display the - all the
time?

I can't change the formatting of the cells, because if the score is
blank (i.e. the match is in the future), then the new cell displays the
date of the match.

I hope that makes sense... :) ,
Chris L
 
Chris

How are you appending?

A1 = 2
B1 = 0

=A1 & "-" & B1 returns 2-0


Gord Dibben MS Excel MVP
 
Chris

How are you appending?

A1 = 2
B1 = 0

=A1 & "-" & B1 returns 2-0


Gord Dibben MS Excel MVP
 
Will this do ...?

=IF(AND(A1<>"",B1<>""),A1 & " - " & B1,"")

Somewhat confused by "if the score is blank (i.e. the match is in the
future), then the new cell displays the date of the match".


HTH
 
Will this do ...?

=IF(AND(A1<>"",B1<>""),A1 & " - " & B1,"")

Somewhat confused by "if the score is blank (i.e. the match is in the
future), then the new cell displays the date of the match".


HTH
 
Gord said:
=A1 & "-" & B1 returns 2-0

Bizarrly that IS what I was using, but without the spaces. Having put
the spaces in, it works perfectly.

I knew it'd be simple! :)

Very many thanks Gord,

Chris.
 
Gord said:
=A1 & "-" & B1 returns 2-0

Bizarrly that IS what I was using, but without the spaces. Having put
the spaces in, it works perfectly.

I knew it'd be simple! :)

Very many thanks Gord,

Chris.
 
Chris

The only spaces my formula contains are for ease of reading only, not to make it
work.

But happy to hear you're happy.

See Toppers' error-checking formula also.


Gord Dibben MS Excel MVP
 
Chris

The only spaces my formula contains are for ease of reading only, not to make it
work.

But happy to hear you're happy.

See Toppers' error-checking formula also.


Gord Dibben MS Excel MVP
 

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

Back
Top