+ Reply to Thread
Results 1 to 14 of 14

Proper syntax for a time formula

  1. #1
    Registered User
    Join Date
    12-04-2012
    Location
    Estacada, OR
    MS-Off Ver
    Excel 2010
    Posts
    97

    Proper syntax for a time formula

    I have an error in the following formula and can't find it

    =ifB28+TIME(0,F16,0)<10:00.00,b28+time(0,f16,0)ifb28+time(0,f16,0)=>10:00.00,b28+time(0,f16,0)+B14))

    Can someone help me sort it out?

  2. #2
    Registered User
    Join Date
    12-04-2012
    Location
    Estacada, OR
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: help sorting out a formula

    Ok I modified the formula and still have a problem:

    if(B28+TIME(0,F16,0)<10:00.00,b28+time(0,f16,0),if(b28+time(0,f16,0)=>10:00.00,b28+time(0,f16,0)+B14))

    Can someone help?

  3. #3
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Proper syntax for a time formula

    Try this:

    =IF(B28+TIME(0,F16,0)<TIME(0,10,0),B28+TIME(0,F16,0),B28+TIME(0,F16,0)+B14)

    - Moo

  4. #4
    Registered User
    Join Date
    12-04-2012
    Location
    Estacada, OR
    MS-Off Ver
    Excel 2010
    Posts
    97

    IF + time function

    I have the following function that returns a #value! that I need help sorting out.

    =IF(B23+TIME(0,F16,0)<TIME(10,0,0)>TIME(12,0,0),B23+TIME(0,F16,0),B23+TIME(0,F16,0)+B14),IF(B23+TIME(0,F16,0)>TIME(12,0,0),B23+TIME(0,F16,0)+B14+TIME(1,0,0))

    B23 = 7:15 AM
    F16 = 143 (which is in minutes)
    B14 = 15 (which is in minutes)

    I am trying to do the following: If the value in F16 (which varies based on a formula) when added to B23 is less than 10 am then add F16 to B23 and display the result
    else if the value in F16 when added to b23 is between 10 am and 12 pm then add F16, B23, and B14
    else if the value in F16 when added to b23 is greater than 12 pm then add F16, B23, B14, and the time (1,0,0)
    Last edited by nicolelschramartin; 12-07-2012 at 01:51 AM.

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: IF + time function

    Try this...

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


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  6. #6
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: IF + time function

    Try this short/elegant version:

    =CHOOSE(LOOKUP(F16/60+B23*24,{0,10,12.01},{1,2,3}),0,B14/1440,B14/1440+1/24)+F16/1440+B23
    Last edited by Teethless mama; 12-07-2012 at 03:00 AM.

  7. #7
    Registered User
    Join Date
    12-04-2012
    Location
    Estacada, OR
    MS-Off Ver
    Excel 2010
    Posts
    97

    time function

    I am trying to understand how the time function works in Excel. Could someone explain why the following returns a value of 0.41

    TIME(HOUR(D23),MINUTE(D23),SECOND(D23)

    D23 = 9:52 am

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

    Re: time function

    format as

    h:mm AM/PM

    and it will return 10:16 AM i.e. 24 min past 9:52 AM
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  9. #9
    Registered User
    Join Date
    12-04-2012
    Location
    Estacada, OR
    MS-Off Ver
    Excel 2010
    Posts
    97

    If + time function

    I have an error in the following formula that I can't find:

    =if(C23<=(10,0,0),C23+time(0,B13,0),C23+time(0,b13,0)+time(0,B14,0))

    I am trying to say if C23 less or equal that 10 am then display C23+B13 (min), else if C23 greater than 10 am then display C24+B13 (min) + b14 (min)

  10. #10
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: If + time function

    =IF(C23< TIMEVALUE("10:00 AM"), C23 + Time(0,B13,0), C23 + TIME(0,B13,0) + TIME(0,B14,0))
    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  11. #11
    Registered User
    Join Date
    12-04-2012
    Location
    Estacada, OR
    MS-Off Ver
    Excel 2010
    Posts
    97

    if and timevalue functions

    =IF(B23<TIMEVALUE("10:00AM"),B23+TIME(0,f16,0),B23+TIME(0,F16,0)+TIME(0,B14,0),if(B23>timevalue("12:00PM"),B23+time(0,F16,0),+time(1,0,0),B23+time(0,B14,0),if(B23>=timevalue("2:30PM"),timevalue("2:30PM",B23+TIME(0,B14,0))))
    B23 = 7:15 AM
    F16 = 143 (which is in minutes)
    B14 = 15 (which is in minutes)

    I am trying to do the following:
    If the value in F16 (which varies based on a formula) when added to B23 is less than 10 am then add F16 to B23 and display the result.
    else if the value in F16 when added to B23 is between 10 am and 12 pm then add F16, B23, and B14 and display the result.
    else if the value in F16 when added to B23 is greater than 12 pm but less than 2:30 pm then add F16, B23, B14, and 1hr
    else if the value in F16 when added to B23 is greater than 2:30 pm then display 2:30 pm

    My formula returns the error “You’ve entered to many arguments for this function.” Can someone help me with this?

  12. #12
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: if and timevalue functions

    Use Vlookup in a table.

    It will shorten your formula, and make it easier to read (and understand).
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  13. #13
    Registered User
    Join Date
    12-04-2012
    Location
    Estacada, OR
    MS-Off Ver
    Excel 2010
    Posts
    97

    IF, timvevalue, and time

    =IF(B23+F16>TIMEVALUE("10:00AM"),B23+TIME(0,F16,0)+TIME(0,B14,0),"stop")


    I want to put the formula results into the field if it is true if false the word stop in the field

  14. #14
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: IF, timvevalue, and time

    you were almost there, you just need a space before the "am"...

    =IF(B23+F16>TIMEVALUE(=IF(B23+F16>TIMEVALUE("10:00 AM"),B23+TIME(0,F16,0)+TIME(0,B14,0),"stop")),B23+TIME(0,F16,0)+TIME(0,B14,0),"stop")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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