+ Reply to Thread
Results 1 to 10 of 10

Display 600 without the zeros

  1. #1
    Registered User
    Join Date
    02-25-2010
    Location
    Virginia
    MS-Off Ver
    Excel 2007
    Posts
    25

    Display 600 without the zeros

    I was trying to figure out a custom cell format to make only the 6 appear when the answer is 600 or 4 when the answer is 400.

    AA9=1700
    X9=1100

    AA9-X9=600 ----> 6 (representing six hours)

    AA9 & X9 represent military times

    Thanks

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Display 600 without the zeros

    Assuming you are using valid time values, just format the cell as [h] and it will display just the hour portion of the result.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,949

    Re: Display 600 without the zeros

    How about:
    Please Login or Register  to view this content.
    Ben Van Johnson

  4. #4
    Registered User
    Join Date
    02-25-2010
    Location
    Virginia
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Display 600 without the zeros

    it doesnt seem to be working..i may just be way off but heres the situation.

    in cell X9 the user inserts what time they started their shift, ex: X9=0500 (represents 5am military format)
    in cell AA9 the user inserts the time their shift ended, ex AA9=1100 (rep 11am mil format
    in the total hours cell AD9, i want it to display how many hours that person worked but display a blank if there is no value

    The formula that I have in there now is:

    AD9=IF((0&X9)+(0&AA9)=0,"",TEXT((0&AA9)-(0&X9),"h")) and I get AD=0

    X9 ,AA9, AD9 all formated as text

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Display 600 without the zeros

    What if the elapsed time were 6:30, or 6:07? How should that be displayed?
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Registered User
    Join Date
    02-25-2010
    Location
    Virginia
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Display 600 without the zeros

    It should be displayed as such: 0530 or 0607....Now we require that the user rounds to the nearest quarter hour...so 0607 would be 0615, and so on....

    Also, i just though of this, If someone inputs the start time as 0500 and their finish time as 1130 can I get the total hrs to display 6.5?

    X9=0500, AA9=1130 AD=6.5?

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Display 600 without the zeros

    Maybe =DOLLARFR(ROUND(DOLLARDE((AA9 - X9) / 100, 60) * 4, 0) / 4, 60)
    Last edited by shg; 03-12-2010 at 02:18 PM.

  8. #8
    Registered User
    Join Date
    02-25-2010
    Location
    Virginia
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Display 600 without the zeros

    that didnt work, it wont do the calc's or even hide the formula

  9. #9
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Display 600 without the zeros

    that didnt work, it wont do the calc's or even hide the formula
    Just covering all bases here: are you certain that the time values are IN FACT valid time entries? If you are using the default horizontal cell alignment, then the values will the right-aligned (wide the cell if necessary to see the effect).

    If you don't have valid time values you will need to convert them from text to numbers using the PasteSpecial multiply (x 1) or add (+ 0) option.

  10. #10
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,949

    Re: Display 600 without the zeros

    Please Login or Register  to view this content.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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