Score conversion trailing zero issue

tigerzen

Board Regular
Joined
Mar 8, 2023
Messages
209
Office Version
  1. 365
Platform
  1. Windows
Got a simple formula to convert goals and behinds into points, each goal is worth 6 points and a behind is worth 1 point. Formula works in all cases except when you have something like 17.10, this should calculate to 17 x 6 + 10 x 1 which equals 112 points. As you can see in the file, it drops the 0 from 17.10 and calculates 103. I've tried Custom formats but no joy here. Is there a way to force TEXTAFTER to recognise the 0 or is there another quick solution?


Book3
ABCDEFGHIJK
1ScoresPoints
23.24.56.79.820294362
37.19.513.817.104359861031
Sheet1
Cell Formulas
RangeFormula
F2:I3F2=INT(A2)*6+(TEXTAFTER(A2,"."))
K3K3=TEXTAFTER(D3,".")
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Your issue is that you are wanting to do string manipulation but entering the data as if it were a number.
You need to force your entered data to be interpreted as text.
Option 1) How do you feel about formatting column A-D as text "before" entering your data (or doing a paste values) ?
If you do that your figures will be held as Text and your formulas should work.

Option 2) Use a symbol that Excel won't convert to a number or a date (ie not a period or "/" or "-")
You will need to change the Int part of the formula as well using this method.
If you have a numeric keypad for entry then the plus sign is the most convenient ie 17+10
 
Upvote 0
Another option would be to enter single scores as .01 like
Fluff.xlsm
ABCDEFGHI
1ScoresPoints
23.024.056.079.0820294362
37.019.0513.0817.1435986112
Master
Cell Formulas
RangeFormula
F2:I3F2=INT(A2)*6+MOD(A2,1)*100
 
Upvote 0
Just to provide some context data comes to me in a single cell ie 3.2 4.5 6.7 9.8, I then use Text to Columns to input each score within its own cell.
 
Upvote 0
Would this work for you ?

Book1
ABCDEFGHIJ
1Source (Hide Column)ScoresPoints
23.2 4.5 6.7 9.83.24.56.79.820294362
37.1 9.5 13.8 17.107.19.513.817.10435986112
Sheet2
Cell Formulas
RangeFormula
G2:J3G2=INT(B2)*6+(TEXTAFTER(B2,"."))
B2:E3B2=TEXTSPLIT(A2," ")
Dynamic array formulas.
 
Upvote 0
Solution
Just to provide some context data comes to me in a single cell ie 3.2 4.5 6.7 9.8, I then use Text to Columns to input each score within its own cell.
When you are doing Text to Columns, when you get to Step 3, click in the first column down the bottom and select Text up the top like in the image below. Repeat for each of the other columns before clicking Finish. Then your formulas in F2:I3 in post #1 will return the correct results.

1692880959936.png
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

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