+ Reply to Thread
Results 1 to 6 of 6

Adding 2 Hours If A Criteria Is Met

  1. #1
    Registered User
    Join Date
    02-01-2021
    Location
    Wigan
    MS-Off Ver
    2010
    Posts
    5

    Adding 2 Hours If A Criteria Is Met

    Hi all,

    On the attached we have a small SQL extract by where all hauliers are given until 18:00 to despatch, however if Hermes is selected they have until 20:00 to despatch. I can't think of a formula to amend the time by 2hrs if Hermes is the haulier.

    I've added how id like the formula to perform in yellow.

    Any help would be amazing thanks.
    Attached Files Attached Files

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

    Re: Adding 2 Hours If A Criteria Is Met

    You can use this formula in F2:

    =INT(B2)+IF(A2="Hermes",TIME(20,0,0),TIME(18,0,0))

    then copy down.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    02-01-2021
    Location
    Wigan
    MS-Off Ver
    2010
    Posts
    5

    Re: Adding 2 Hours If A Criteria Is Met

    That's great. Thanks

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

    Re: Adding 2 Hours If A Criteria Is Met

    You're welcome, and thanks for marking the thread as Solved.

    As you are relatively new to the forum, you might also like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

  5. #5
    Registered User
    Join Date
    02-01-2021
    Location
    Wigan
    MS-Off Ver
    2010
    Posts
    5

    Re: Adding 2 Hours If A Criteria Is Met

    Quote Originally Posted by Pete_UK View Post
    You're welcome, and thanks for marking the thread as Solved.

    As you are relatively new to the forum, you might also like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

    No problem, another small question. I actually have Hermes & Hermes ROTW. How can I add "Hermes ROTW" to the formula please?

    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
    20,899

    Re: Adding 2 Hours If A Criteria Is Met

    It is easier just to look at the first 6 letters - try this in F2:

    =INT(B2)+IF(LEFT(A2,6)="Hermes",TIME(20,0,0),TIME(18,0,0))

    then copy down again.

    Hope this helps.

    Pete

+ 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. adding and subtract hours and minutes with 5 digit hours
    By emiliopena2 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-09-2019, 08:44 PM
  2. Adding Hours Worked on Employee Schedule based on varying daily criteria
    By CGF2704 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-07-2016, 11:19 AM
  3. [SOLVED] Weekly hours and daily hours not adding up
    By Shareez Saleem in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 07-15-2015, 12:13 PM
  4. [SOLVED] Adding hours to start time - Business hours/holidays/weekends
    By Thunderer in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-21-2014, 01:09 PM
  5. [SOLVED] adding hours
    By pannam in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-28-2014, 01:29 AM
  6. [SOLVED] Adding Hours Worked minus lunch break IF over 5 hours
    By Gtrtim112 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-15-2013, 11:16 PM
  7. Adding daily run hours to cumulative total hours
    By Rodstew in forum Excel General
    Replies: 8
    Last Post: 08-08-2012, 07:10 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