Compare two numbers separated by a dash

Brutality

New Member
Joined
Feb 5, 2003
Messages
44
Not sure if this can be done without separating the numbers out into different columns, but here is the scenario; I have a spreadsheet containing match scores. Scores have been entered in the format 10-8 (in a single cell) and I need to determine the winner I.E. which number is bigger, the left or right. Any ideas? I've messed with mid() and value(left()) but cant get the result I am after. All help appreciated.

TIA
Mark
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Not sure if this can be done without separating the numbers out into different columns, but here is the scenario; I have a spreadsheet containing match scores. Scores have been entered in the format 10-8 (in a single cell) and I need to determine the winner I.E. which number is bigger, the left or right. Any ideas? I've messed with mid() and value(left()) but cant get the result I am after. All help appreciated.

TIA
Mark
Are ties possible?

=IF(--LEFT(A2,FIND("-",A2)-1)>-MID(A2,FIND("-",A2),5),"Left","Right")
 
Last edited:
Upvote 0
Ooops, yes they are, my bad sorry. The idea here is to give the winner 2 points, the loser 0, and 1 for a tie. So far your code works well and I will attempt to modify the rest myself. Thanks for the swift reply and working formula Mr Valko!
 
Upvote 0
If A1 contain match scores:

Code:
=IF(--LEFT(SUBSTITUTE(A1,"-",REPT(" ",2)),2)>--RIGHT(SUBSTITUTE(A1,"-",REPT(" ",2)),2),"Win-Loss",IF(--LEFT(SUBSTITUTE(A1,"-",REPT(" ",2)),2)<--RIGHT(SUBSTITUTE(A1,"-",REPT(" ",2)),2),"Loss-Win","Balance"))
 
Upvote 0
Ooops, yes they are, my bad sorry. The idea here is to give the winner 2 points, the loser 0, and 1 for a tie. So far your code works well and I will attempt to modify the rest myself. Thanks for the swift reply and working formula Mr Valko!
You might be better off separating the numbers to individual cells.

It ought to be pretty easy using Data>Text to Columns>Delimited by the dash.
 
Upvote 0
I've looked at that option T Valko and had it working but it requires a lot of "re-arranging of data" in the current provided spreadsheet and was trying to avoid such an approach.

Bebo, great, perfect, thanks!

I appreciate both of your solutions. Cheers.
 
Upvote 0
If the score is in A1, the named value =SIGN(EVALUATE(A1))+1 will return the 2,1,0 score of the left side team.
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,297
Members
452,903
Latest member
Knuddeluff

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