Formula help

G

George Gee

Hi all

In cell G7 I have a football score, (user input) in the form of (e.g.) 2 2
(note the space between the two numbers).

In G6 I want a formula that displays "Win" "Lose" or "Draw", dependant upon
the input score:

So if the leftmost number is greater than the rightmost number, "Win".

If the leftmost number is smaller than the rightmost number "Lose".

If the leftmost number is equal to the rightmost number "Draw".

Many thanks for your time.
 
L

Leo Heuser

Hi George

One way assuming one digit for either result:

=IF(LEFT(G7,1)>RIGHT(G7,1),"Win",IF(LEFT(G7,1)<RIGHT(G7,1),"Lose","Draw"))
 
G

George Gee

Hi Leo

Many thanks for that, it works fine.
It would be a rare day indeed for a score of more than 9 in English league
football!

George
 
L

Leo Heuser

Hi George

You're welcome and thanks for the feedback :)

Should the day come, this formula can be used
regardless of the number of digits. The number
of spaces between the two results don't matter.

=IF(VALUE(LEFT(G7,FIND(" ",G7)))>
VALUE(MID(G7,FIND(" ",G7),1000)),"Win",
IF(VALUE(LEFT(G7,FIND(" ",G7)))<
VALUE(MID(G7,FIND(" ",G7),1000)),"Lose","Draw")

Entered as one line.

LeoH
 
G

George Gee

Hi Leo

Have noted your update, many thanks once again.


--
George



*Leo Heuser* has posted this message:
 

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