+ Reply to Thread
Results 1 to 18 of 18

Time Based formula

  1. #1
    Registered User
    Join Date
    07-31-2020
    Location
    India
    MS-Off Ver
    13
    Posts
    10

    Post Time Based formula

    HI, I am looking for time based formula.Below is the condition to be applied.

    If it's saturday and time is between 8.30 AM to Sunday 8.29 AM then pay one Rate
    If it's Sunday and time is between 8.30 AM to Monday 4.00 AM then pay one Rate

    All the formula to be linked to one cell.

    Can some assist on this.

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,737

    Re: Time Based formula

    How is you data laid out , a sample sheet would help

    Is the date and time in the same cell ?

    An IF combined with an AND & Weekday should solve for you
    If it a normal weekday is that pay Rate 3 or not interested in rest of week
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    07-31-2020
    Location
    India
    MS-Off Ver
    13
    Posts
    10

    Re: Time Based formula

    Yes, both in same cell. the pay is only for specified time. If those condition is satisfy then count 1 * Rate
    Last edited by vijaysharmad; 07-31-2020 at 04:34 AM.

  4. #4
    Registered User
    Join Date
    07-31-2020
    Location
    India
    MS-Off Ver
    13
    Posts
    10

    Re: Time Based formula

    Actdate
    5/1/2020 8:25:00 AM
    5/1/2020 8:26:00 AM
    5/1/2020 8:27:00 AM
    5/1/2020 8:29:00 AM
    5/1/2020 8:30:00 AM
    5/1/2020 8:30:00 AM

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

    Re: Time Based formula

    Assuming A1 is date

    try:
    Please Login or Register  to view this content.
    Quang PT

  6. #6
    Registered User
    Join Date
    07-31-2020
    Location
    India
    MS-Off Ver
    13
    Posts
    10

    Re: Time Based formula

    Thanks, let me modify a bit.....can you assist in this case

    If it's saturday and time is between 8.30 AM to Sunday 8.29 AM then 1 (numerice 1 should appear), else 0
    If it's Sunday and time is between 8.30 AM to Monday 4.00 AM then 1 (numerice 1 should appear), else 0

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

    Re: Time Based formula

    Does it work for you?

    =IF(WEEKDAY(A1,16)+MOD(A1,1)<1+"8:29:59",0,IF(WEEKDAY(A1,16)+MOD(A1,1)<3+"3:59:59",1,0))

  8. #8
    Registered User
    Join Date
    07-31-2020
    Location
    India
    MS-Off Ver
    13
    Posts
    10

    Re: Time Based formula

    Hi Bebo, good attempt, however the same is showing Zero for below case

    5/1/2020 8:25:00 AM - Here the 1st may is Sunday, then it satisfy my first condition.


    In below case, it showing 1 and per the condition it should be Zero.
    5/2/2020 8:30:00 AM - Here 2nd May is Monday and time is after 4 AM.

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

    Re: Time Based formula

    Quote Originally Posted by vijaysharmad View Post
    5/1/2020 8:25:00 AM - Here the 1st may is Sunday, then it satisfy my first condition....
    I wonder if my computer calendar goes wrong? May 1st 2020 is Friday

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Time Based formula

    May 01 2020 was indeed a Friday.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  11. #11
    Registered User
    Join Date
    07-31-2020
    Location
    India
    MS-Off Ver
    13
    Posts
    10

    Question Re: Time Based formula

    Thanks Bebo, your solution worked like magic.

    However, I am stuck with one dilemma..... I need your assistance in the below

    Assume Cell E2 Assume Cell K2
    Weekday Bundle length Rate
    saturday and time is between 8.30 AM to Sunday 8.29 AM 20 100
    saturday and time is between 8.30 AM to Sunday 8.29 AM 40 200
    Sunday and time is between 8.30 AM to Monday 4.00 AM 20 300
    Sunday and time is between 8.30 AM to Monday 4.00 AM 40 400

  12. #12
    Registered User
    Join Date
    07-31-2020
    Location
    India
    MS-Off Ver
    13
    Posts
    10

    Re: Time Based formula

    And Yes, you were right with regard dates.

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

    Re: Time Based formula

    Try to upload a worksheet please

  14. #14
    Registered User
    Join Date
    07-31-2020
    Location
    India
    MS-Off Ver
    13
    Posts
    10

    Re: Time Based formula

    Sample file attached for your reference
    Attached Files Attached Files

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

    Re: Time Based formula

    Try:
    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    07-31-2020
    Location
    India
    MS-Off Ver
    13
    Posts
    10

    Re: Time Based formula

    Thanks Bebo, It works....i acknowledge you are Maestro in excel.....

    If I want to change the day from Saturday to Friday or Timing from evening 6 PM, then what I need to change in the formula

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

    Re: Time Based formula

    Try to study how WEEKDAY(date,k) works. Im using k=16 for Sat. For friday, k=15.

    For "6:00PM" use "5:59:59"

  18. #18
    Registered User
    Join Date
    07-31-2020
    Location
    India
    MS-Off Ver
    13
    Posts
    10

    Re: Time Based formula

    Hi Bebo, this is not working,

    For eg, if it's Saturday it's 4/11/2020 9:48:00 AM, then it is getting picked in my calculation.

    The condition here is Pay only from Saturday 6:00:00 PM to Monday 6:00:00 AM

    Can you assist me with a solution, the rest of parameters remains same like time and date is available in one cell....no need to worry about 20/40 bundles.

+ 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. [SOLVED] 1) Sum based on time. 2) average per day formula
    By pmw19800 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-04-2019, 09:26 AM
  2. [SOLVED] time sheet help, format TIME and formula based on the actual time entered.
    By bh mng in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 12-06-2016, 01:10 PM
  3. [SOLVED] Fix/add time to existing time based formula
    By nickfalco in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-13-2016, 05:59 AM
  4. [SOLVED] Formula to fill C5 with a time that makes J5 equal 8 hours based on time put into B5
    By possumbarnes in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-26-2015, 10:08 PM
  5. [SOLVED] If Formula Based on Current Time
    By Jiptastic in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-13-2013, 04:21 PM
  6. Formula runs based on time
    By city in forum Excel General
    Replies: 3
    Last Post: 06-22-2012, 01:58 PM
  7. IF Function Formula Based On Time.
    By artiststevens in forum Excel General
    Replies: 4
    Last Post: 12-15-2010, 08:22 AM

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