+ Reply to Thread
Results 1 to 13 of 13

IF formula is too long, can it be shortened?

  1. #1
    Registered User
    Join Date
    01-24-2013
    Location
    Newark, UK
    MS-Off Ver
    Excel 2010
    Posts
    15

    IF formula is too long, can it be shortened?

    I have made an IF formula to work out starting hours on a timesheet, were lateness is rounded up.
    If somebody clocks in 3 minutes past the quarter hour they are fine, four minutes past and it goes to the next 15 minutes.
    for example: 6.03 is 6.00 start, but 6.04 is 6.15 start.
    here is the formula i have but i would like to simplify it by getting rid of every hour any saying if the time is *:03 = 6.00 and if its *.04 = 6.15.

    =IF($B$6<5.03,"5.00",IF($B$6<5.18,"5.15",IF($B$6<5.33,"5.30",IF($B$6<5.48,"5.45",IF($B$6<6.03,"6.00",IF($B$6<6.18,"6.15",IF($B$6<6.33,"6.30",IF($B$6<6.48,"6.45"))))))))

    Any ideas?????

  2. #2
    Registered User
    Join Date
    01-24-2013
    Location
    Newark, UK
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: IF formula is too long, can it be shortened?

    Here is a copy of what i have so far
    Attached Files Attached Files

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: IF formula is too long, can it be shortened?

    Here, try this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    01-24-2013
    Location
    Newark, UK
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: IF formula is too long, can it be shortened?

    results in =N/A

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: IF formula is too long, can it be shortened?

    Is the B6 formated as time?
    If yes, try this:
    Please Login or Register  to view this content.
    If no, we have to convert time in TEXT to TIME format.

    Edit: Post sent before finding the new post from OP with file attached. Will be back soon.
    Last edited by bebo021999; 01-24-2013 at 11:13 AM.
    Quang PT

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: IF formula is too long, can it be shortened?

    Where are you actually using this formula?

    I can't seem to find it anywhere in the workbook.

    I did find this similiar formula in C6:C12 on 'my play'.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  7. #7
    Registered User
    Join Date
    01-24-2013
    Location
    Newark, UK
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: IF formula is too long, can it be shortened?

    that is the closest i have had yet, i have changed to time format but would prefer it in text format so 06:30:00 is 6.30
    i also need the formula for finish times too, if possible

  8. #8
    Registered User
    Join Date
    01-24-2013
    Location
    Newark, UK
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: IF formula is too long, can it be shortened?

    the formula may be slightly different, it is formula in cells C6 and E6 i am after

  9. #9
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: IF formula is too long, can it be shortened?

    Try in C6:
    Please Login or Register  to view this content.
    Could you pls explain the rule for finish time?

  10. #10
    Registered User
    Join Date
    01-24-2013
    Location
    Newark, UK
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: IF formula is too long, can it be shortened?

    rule is paid to nearest quarter hour.

  11. #11
    Registered User
    Join Date
    01-24-2013
    Location
    Newark, UK
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: IF formula is too long, can it be shortened?

    Quote Originally Posted by bebo021999 View Post
    Is the B6 formated as time?
    If yes, try this:
    Please Login or Register  to view this content.
    If no, we have to convert time in TEXT to TIME format.

    Edit: Post sent before finding the new post from OP with file attached. Will be back soon.
    This formula has worked best so far, except if the time is 7:48 - it doesnt change to 8:00

  12. #12
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: IF formula is too long, can it be shortened?

    Quote Originally Posted by gordymoore5 View Post
    This formula has worked best so far, except if the time is 7:48 - it doesnt change to 8:00
    You said that if 3 minutes past the quarter is OK, that means 7:48 should be 7.45, is that right?
    By the way, does the formula with TEXT in #9 work?

  13. #13
    Registered User
    Join Date
    01-24-2013
    Location
    Newark, UK
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: IF formula is too long, can it be shortened?

    Yes 7.48 should be 7.45. no the text formula didnt work

+ 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