Curiosity question, what calculation is happening here?

lefecious

New Member
Joined
Apr 26, 2010
Messages
7
If a cell is formatted to "general" and you type in 12-4, then hit enter, the cell changes to "4-Dec". Makes sense, but I don't want the date, I just want to show "12-4"

So I go change the format for the cell to "number" and then I type in 12-4, hit enter, and it changes to "43438.00"

What the heck is going on there?

I did finally format the cell to "text" so it would show "12-4" like I wanted it to, but now I'm just curious about the above, how it arrived at 43438.00 when I type in 12-4 if the cell is formatted as "number." I don't get what kind of calculation is taking place there and how it's leading to that result.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Excel is over-helpfully interpreting 12-4 as a date.
To get it to read it as as a string, type a ' first, it won't show in the cell.

type:
'12-4
 
Upvote 0
Keep in mind that Excel stores dates as numbers. 1/1/1900 was 1, 1/2/1900 (Jan. 2, 1900) was 2, and so on. This makes 12/4/2018 = 43438, or 43438 days since 1/1/1900. You usually don't see these numbers, since Excel formats dates into something more readable. But when you entered 12-4, Excel thought it was a date and internally stored it as 43438, but formatted it as 4-Dec. But when you changed the format, you see the number.
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,809
Members
449,048
Latest member
greyangel23

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