Cell Format: Fractions vs Number

Fujirich

Active Member
Joined
May 1, 2003
Messages
320
Seems like forever since I been working on an Excel project that brought me here to ask a question, but here goes...

I have a problem with cells changing their number format after the first entry.

I have two columns set up for the user to input a measurement, and then immediately to the right of each, the next cell is a validated list of measurement types: in, ft, mm, cm.

The idea is that the user enters the dimensions of the item and then picks the measurement type. Maybe it's 31 1/2 in x 40 9/16 in if using imperial measures. But they might also use metric. In that case, it might be 77.47 cm x 103.03 cm. Both the numbers entered and the measurement type are then used to figure out the area of the item in question. Simple!

But here's the problem: if the user first entered a fraction, Excel changes the cell format from general to fraction. If the user goes back and decides they want to now enter a measurement in metric format, the cell format remains in fractions, making entry problematic (anything after a decimal will be converted to a fraction).

I'm not trying to convert the entered number upon changing the measurement type (nothing that fancy). Just trying to figure out how to handle the formatting of the cell with the measurement number so that it can accept both type of entries and not get forced to one style.

Any thoughts?
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Not sure if you use VBA/macros, but have you thought about using an InputBox to get the information from the user, then formatting the resulting number in the cell(s) accordingly?
 
Upvote 0
Actually, I had not thought about that approach.

It's a good idea. It might be more involved than I was hoping for on this fairly simple project, but perhaps a good course of action. Thanks!

I'm hoping something better exists, but that might be my solution.
 
Upvote 0
Could you help me, plz. I need an Excel formula that will allow me to figure out a fraction from the total. It should count cells E.g.
cell A1 1
cell A2 0
cell A3 1
cell A4 1
cell A5 3/4
total should be 3 out of 4 or 3/4

thank you very much!
 
Upvote 0
Could you help me, plz. I need an Excel formula that will allow me to figure out a fraction from the total. It should count cells E.g.
cell A1 1
cell A2 0
cell A3 1
cell A4 1
cell A5 3/4
total should be 3 out of 4 or 3/4

thank you very much!

=Sum(A1:A4) & "/" & Count(A1:A4)

should to the trick, then just format the cell for fractions.
 
Upvote 0

Forum statistics

Threads
1,224,524
Messages
6,179,308
Members
452,904
Latest member
CodeMasterX

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