Use > or < for hyphenated cell

honkin

Active Member
Joined
Mar 20, 2012
Messages
385
Office Version
  1. 2016
Platform
  1. MacOS
hi

Is it possible to check greater than or less than in a cell with a hyphenated number? I do not wish to create a further helper column unless that is the only way to achieve what I am after.

I have a sheet with football scores in it and they come like this 1-0, 2-2, 2-1 etc. Is it possible in a formula to check if one part is higher or lower than the other part? The idea is to be able to automate adding W (win), L (loss) or D (draw) in the results column

I guess in plain English, it would read something like this; IF number to the right of the hyphen is > than number to the left of the hyphen, L, otherwise W. Draw is not really required, so just W & L

How would this be achieved?

cheers in advance
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
=IF(--LEFT(A1,FIND("-",A1)-1)>--RIGHT(A1,LEN(A1)-FIND("-",A1)),"W",IF(--LEFT(A1,FIND("-",A1)-1)=--RIGHT(A1,LEN(A1)-FIND("-",A1)),"D","L"))
 
Upvote 0
Solution

Forum statistics

Threads
1,223,228
Messages
6,170,874
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top