+ Reply to Thread
Results 1 to 8 of 8

Subtracting one date for another using Countif criteria

  1. #1
    Forum Contributor
    Join Date
    08-20-2012
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    184

    Subtracting one date for another using Countif criteria

    Hi
    I have a query which I hope that you can help me with.
    I have a formula which counts how many duplicates there are in a list of ID’s. (below)
    Please Login or Register  to view this content.
    What I need is another formula which basically finds the last duplicate and then subtracts the difference in dates from the first duplicate and the last duplicate to give the number of days.
    The formula I am using to find the last duplicate is:
    Please Login or Register  to view this content.
    The dates are in Column B.
    Is this possible?
    I would really appreciate some help with this.

    Many Thanks in advance.

  2. #2
    Forum Contributor
    Join Date
    08-20-2012
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    184

    Re: Subtracting one date for another using Countif criteria

    Hi

    Any help on this would be greatly appreciated.

    Many thanks in advance.

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Subtracting one date for another using Countif criteria

    perhaps a sample workbook?
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Forum Contributor
    Join Date
    08-20-2012
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    184

    Re: Subtracting one date for another using Countif criteria

    Hi

    I hope this works. I have attached it below. Basically, I need to subtract the last tx date from the first to get the difference in the number of days (Column A).



    test file.xlsx

    Many thanks in advance.

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Subtracting one date for another using Countif criteria

    In G3 and copy down.

    =IF(F3="","",SUM(INDEX($A$2:$A$1000,MATCH(D3&"Last Duplicate",$D$2:$D$1000&$F$2:$F$1000,0)))-SUM(INDEX($A$2:$A$1000,MATCH(D3&"Duplicate # 1",$D$2:$D$1000&$E$2:$E$1000,0))))


    ARRAY formula.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Subtracting one date for another using Countif criteria

    try it this way
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    08-20-2012
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    184

    Re: Subtracting one date for another using Countif criteria

    Thank you both very much for your help. It is what I was looking for.

  8. #8
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Subtracting one date for another using Countif criteria

    You are welcome from both of us!

+ 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