+ Reply to Thread
Results 1 to 9 of 9

Finding difference in dates for repeat entries

  1. #1
    Registered User
    Join Date
    06-13-2012
    Location
    Tulsa, Oklahoma
    MS-Off Ver
    Excel 2007
    Posts
    21

    Finding difference in dates for repeat entries

    I have a file that I have pulled, using conditional formatting that shows repeat customers, and the dates they placed their orders. I want to show my boss a: how many times each customer has ordered, and the frequency of those orders using the data. Order Sample For Forum.xlsx

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Finding difference in dates for repeat entries

    =COUNTIF(C:C,C2) dragged down will give you number of times a customer has ordered.

    You can also use pivit tables to achieve that
    www.cpearson.com/excel/pivots.htm

    What do you mean by frequency of orders?
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Registered User
    Join Date
    06-13-2012
    Location
    Tulsa, Oklahoma
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Finding difference in dates for repeat entries

    by frequency, I mean, how much time in between orders... once a month, twice a month, twice annually, or annually. I will try the countif formula, which is what I was thinking to begin with, but that date/frequency part is puzzling. THANKS

  4. #4
    Registered User
    Join Date
    06-13-2012
    Location
    Tulsa, Oklahoma
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Finding difference in dates for repeat entries

    also found that I needed to tweek the formula just a bit. " COUNTIF($C:$C,C2) " so that it changed per row. But works for that purpose just fine. Thanks again

  5. #5
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Finding difference in dates for repeat entries

    One way of approcahing frequency..

    - Find earliest date of order for each customer
    - Find latest date of order for each customer

    (Diff between dates) divided by (number of orders less one) is frequency of ordering. Hence use
    In row 2
    =IFERROR((MAX(IF(C:C=C2,B:B))-MIN(IF(C:C=C2,B:B)))/(COUNTIF(C:C,C2)-1),"")

    confirm with Ctrl+Shift+Enter and not just Enter

    If a customer has ordered only once, there will be no frequency calculated, if twice its simply the difference between dates of orders, if more than twice its difference between dates divided by no. of orders less one

    Does this work for you?

  6. #6
    Registered User
    Join Date
    06-13-2012
    Location
    Tulsa, Oklahoma
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Finding difference in dates for repeat entries

    Problem is "Customer A, has ordered 5 times in the last six months, customer B has ordered 3 times in the last six months, You are given the dates of the orders, but how often has each customer ordered... is it once a month, or what. I can already do a formula that would show if it's been a month, or two since their last order, but to show the boss how often they order (and to make this project easier in the future) I need a frequency calculation.

  7. #7
    Registered User
    Join Date
    06-13-2012
    Location
    Tulsa, Oklahoma
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Finding difference in dates for repeat entries

    AWESOME. I'll give it a try

  8. #8
    Registered User
    Join Date
    06-13-2012
    Location
    Tulsa, Oklahoma
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Finding difference in dates for repeat entries

    Well that just confused me. With the date data, in B2 (5/1/2012) and B3 (4/18/2012) according to the formula =IFERROR((MAX(IF(C:C=C2,B:B))-MIN(IF(C:C=C2,B:B)))/(COUNTIF(C:C,C2)-1),"") the result is 179... there's no way 179 days passed in a month

  9. #9
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Finding difference in dates for repeat entries

    Ensure that you confirm the formula with Ctrl+Shift+Enter as its an array formula. This will give you 13 as a result.

    www.cpearson.com/excel/array.htm

+ 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