# Adding 2 Hours If A Criteria Is Met

1. ## 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.

2. ## 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. ## Re: Adding 2 Hours If A Criteria Is Met

That's great. Thanks

4. ## 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. ## Re: Adding 2 Hours If A Criteria Is Met

Originally Posted by Pete_UK
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. ## 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

##### Users Browsing this Thread

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

#### 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