+ Reply to Thread
Results 1 to 9 of 9

using RIGHT to always get fractional points

  1. #1
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Key West, FL
    MS-Off Ver
    365 Apps for Enterprise
    Posts
    665

    using RIGHT to always get fractional points

    I've attached a workbook which contains hourly data in column A. In column F I want to only obtain the timestamp from A if the hour is 23:00.

    I've tried using RIGHT to get the last 5 digits from column A but the result is gibberish. Instead of 23:00 I'm getting 33333.


    Then I tried ROUNDDOWN column A to 2 digits, then using RIGHT to pick only the hours that have fractional points of .95. This worked well until the date (in Excel format) happened to be 43795. At this point, the method is picking two times on that date rather than one. (you'll see this in the highlighted rows of the attached workbook).

    Any advice on how to consistently obtain the correct timestamp of 23:00 every time?

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: using RIGHT to always get fractional points

    Try

    =IF(HOUR(A2)=23,A2,"")


    Format as m/d/yyyy h:mm or h:mm as appropriate
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,800

    Re: using RIGHT to always get fractional points

    You can use this formula in F2:

    =IF(HOUR(A2)=23,INT(A2),"")

    then copy down as required. You can see that it doesn't need any of the other columns that you have used.

    Hope this helps.

    Pete

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,407

    Re: using RIGHT to always get fractional points

    I interpreted a little differently. It sounds like you want to strip the time from column A but only when the hour is 23.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and then format h:mm

    (What about when it isn't = 23?)
    Dave

  5. #5
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Key West, FL
    MS-Off Ver
    365 Apps for Enterprise
    Posts
    665

    Re: using RIGHT to always get fractional points

    Thanks. Both solutions work because what we're looking at is an intermediate step. If the hour is not 23:00 then the column to the right can be "" or 0. Unfortunately I've got another prob in the workbook involving VLOOKUP suddenly failing, so I'll create a new post on it soon. Thanks!

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,800

    Re: using RIGHT to always get fractional points

    Hi Dave,

    Column F was formatted as a date, and if it was just the time that was required then you could just return 23, or TIME(23,0,0)

    Pete

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,407

    Re: using RIGHT to always get fractional points

    Yup. I was confused on how to interpret this one. I finally settled my focus on this part
    I've attached a workbook which contains hourly data in column A. In column F I want to only obtain the timestamp from A if the hour is 23:00.
    Knowing full well I could be completely wrong.

    I also wanted to make allowances for say 23:21, 23:45 ... etc. There were no minutes in the upload, but I didn't know if that was oversight on the OP's part or if it reflected reality at their end.

    Thanks for the heads-up.
    Last edited by FlameRetired; 01-29-2020 at 02:26 PM.

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,800

    Re: using RIGHT to always get fractional points

    Yes, it was ambiguous.

    Anyway, the OP seems to be saying that we were both right !!

    Pete

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,407

    Re: using RIGHT to always get fractional points

    Yep! and LOL

+ 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. Excel 2007 : Removing zero from a fractional number
    By scrufy in forum Excel General
    Replies: 2
    Last Post: 01-08-2011, 09:36 AM
  2. fractional display
    By pdelnet in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 11-23-2007, 11:18 AM
  3. ddb and fractional periods
    By stephenn in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-08-2007, 01:38 PM
  4. Exacting the fractional
    By TaGY2K in forum Excel General
    Replies: 3
    Last Post: 07-26-2006, 04:30 PM
  5. How to sort with fractional
    By TaGY2K in forum Excel General
    Replies: 3
    Last Post: 07-24-2006, 06:05 PM
  6. Fractional part of decimals?
    By Zerex71 in forum Excel General
    Replies: 9
    Last Post: 06-29-2006, 03:40 AM
  7. Fractional Workday Function
    By Jeanette in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-19-2006, 02:00 PM
  8. Lookup based on fractional value
    By Ted Metro in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-04-2006, 04:40 PM

Tags for this Thread

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