+ Reply to Thread
Results 1 to 16 of 16

Change Format of Cell into a Number (it thinks it's a date)

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Change Format of Cell into a Number (it thinks it's a date)

    I am having slight trouble with the formatting of some cells. Every month I will be copying data into a row, the problem is Excel thinks it's a date instead of an integer of some sort.

    The value copied will look something like this:
    79:42:00
    (meaning 79 hours and 42 minutes)

    Excel is taking that and interpreting it as:
    1/3/1900 7:42:00 AM

    Is there an easy way to format this so Excel thinks it's a number (even if 79.7).

    I tried to change the format of the cell to "Text", but it changes it to: 3.32083333333333

    Thanks again!
    Last edited by nkitchen31; 12-15-2013 at 07:44 PM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Change Format of Cell into a Number (it thinks it's a date)

    if you want it to display as
    79:42:00
    just format the cell as custom [hh]:mm:ss
    further though is to format the cell as text before pasting and it will display as text
    Last edited by martindwilson; 12-15-2013 at 07:47 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Change Format of Cell into a Number (it thinks it's a date)

    Format as [h]:mm:ss or, if you only want the hours and minutes [h]:mm.

    The brackets [ ] will keep the hours from rolling over into days.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Change Format of Cell into a Number (it thinks it's a date)

    It already is… the problem is when I use that cell to divide with.

    For example, that number 79:42:00 is supposed to represent 79 hours and 42 minutes. if I divide that by 16 days, I want the answer to be displayed. But right now it doesn't accept that cell at 79 hours and 42 minutes, it thinks of it as a date and if I change to number or text it gets displayed as 3.32.

    Screen Shot 2013-12-15 at 6.36.00 PM.jpg

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Change Format of Cell into a Number (it thinks it's a date)

    i dont follow that it shows as a date is irrelevant
    03/01/1900 07:42:00 is just a number its the format that makes it look like that
    it is actually 3 days and 7hrs 42 minutes ie 79:42 or 3.320833333 days
    if you divide that by 16 you get 4:58:52 when formatted as time
    what result are you expecting?

  6. #6
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Change Format of Cell into a Number (it thinks it's a date)

    Instead of it showing 3.3 days, I need it to show as 79 hours lol.. because I will be dividing that many hours by a specific number of days.

    79 hours divided by 16 is 4.9375 .. that's the result I am expecting (4.9375 hours per day)
    Not 3.3 divided by 16..

    If I format it as text, it appears in the cell as 3.3208. If I put this formula in another cell: "=F10*24" (days * 24 hours), the answer I get is 19.. wtf? I don't even see how that's possible.

    Thanks.
    Last edited by nkitchen31; 12-15-2013 at 08:15 PM.

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Change Format of Cell into a Number (it thinks it's a date)

    4:58:52 is the result when divided by 16 and as you have found out you need to multiply by 24
    which would give
    4.98125 hrs

  8. #8
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Change Format of Cell into a Number (it thinks it's a date)

    Yes, that is correct, but that is not the answer that I am getting in my cell lol

    Quote Originally Posted by martindwilson View Post
    4:58:52 is the result when divided by 16 and as you have found out you need to multiply by 24
    which would give
    4.98125 hrs

  9. #9
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Change Format of Cell into a Number (it thinks it's a date)

    Would you mind looking for me?
    Here it is…

    New Formula.xlsx

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Change Format of Cell into a Number (it thinks it's a date)

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  11. #11
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Change Format of Cell into a Number (it thinks it's a date)

    why is the cell formatted as dd ? when you do that you just take the cell value of 79.7 and display it as a day
    day 79 is 19 March 1900 so dd displays 19 format as general to get 79.7

  12. #12
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Change Format of Cell into a Number (it thinks it's a date)

    WOW! Didn't even realize it was formatted as "dd" … So sorry for the confusion.. Yes now it's 79.7! Thank you for your patience!

  13. #13
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Change Format of Cell into a Number (it thinks it's a date)

    Argh… okay, well now the "DAYS ON" column is showing crazy numbers because C5 (the formula to show number of days in the month) is formatted as "dd"… But it has to be formatted like that because otherwise it shows 41,305.

    Any ideas how to fix this?

    New Formula.xlsx
    Last edited by nkitchen31; 12-15-2013 at 08:41 PM.

  14. #14
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Change Format of Cell into a Number (it thinks it's a date)

    =DAY(EOMONTH(--("1/"&A2&YEAR(TODAY())),0)) use this option instead that will give 31 formatted general

  15. #15
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Change Format of Cell into a Number (it thinks it's a date)

    A few keystrokes shorter:

    =DAY(EOMONTH("1/"&A2&YEAR(NOW()),0))

  16. #16
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Change Format of Cell into a Number (it thinks it's a date)

    perfect! thanks again!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Change backwards number format to date format
    By vickie10200 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-10-2013, 01:32 PM
  2. Replies: 1
    Last Post: 11-01-2012, 10:37 AM
  3. Replies: 1
    Last Post: 11-29-2010, 12:10 PM
  4. Formulae to change text formatted date to number format
    By shekar goud in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-11-2010, 01:57 PM
  5. Change cell number format in VBA
    By hemi_fan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-09-2010, 06:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1