+ Reply to Thread
Results 1 to 6 of 6

Calculate number of days depending on some date criteria

  1. #1
    Forum Contributor
    Join Date
    08-24-2009
    Location
    Manila, Philippines
    MS-Off Ver
    MS 365 Subscription Insider (Windows 11 64-bit)
    Posts
    120

    Calculate number of days depending on some date criteria

    Hi Everyone,

    I need to have a formula in Column D that will calculate the Total EOT (Extension of time Days) depending on the person's mob/demob date. If he is present within the EOT period, he will get EOT days. I have attached a file that describes different criteria.

    Thanks for your help.
    Attached Files Attached Files

  2. #2
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Calculate number of days depending on some date criteria

    Try this in D5 and dragged down:

    =MAX(IF(AND(B5<$H$3,C5>$I$3),$J$3,IF(AND(B5>=$H$3,C5<=$I$3),C5-B5,IF(B5>=$H$3,MIN($I$3,C5)-B5,C5-MAX($H$3,B5)))),0)

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Calculate number of days depending on some date criteria

    Hi rickyilas,


    Try this:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Forum Contributor
    Join Date
    08-24-2009
    Location
    Manila, Philippines
    MS-Off Ver
    MS 365 Subscription Insider (Windows 11 64-bit)
    Posts
    120

    Re: Calculate number of days depending on some date criteria

    Thanks to both of you....both formula works for me.

  5. #5
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Calculate number of days depending on some date criteria

    You're welcome and thanks for the 'star tap' but I hope you went with xladept's solution. It was what I was trying for but it just wasn't coming to me so I settled for what I posted.

  6. #6
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Calculate number of days depending on some date criteria

    Or, you can replace IF with MAX(0, in xladapt's formula,

    =MAX(0,MIN(C5,I$3)-MAX(B5,H$3))
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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