+ Reply to Thread
Results 1 to 13 of 13

Calculating the number of people who have purchased more than once, over rolling periods

  1. #1
    Forum Contributor
    Join Date
    05-09-2019
    Location
    South West
    MS-Off Ver
    365
    Posts
    113

    Calculating the number of people who have purchased more than once, over rolling periods

    Hi all,

    I have sales data which has been pivoted to show the number of purchases people have made per month, over the last year.

    I need to do a formula that will count the number of people who have purchased more than once, per 3 month period (i.e. we're looking at repeat purchasers).

    I've attached an example of how the data looks and the expected outcomes (just for a couple of 3 monthly periods, rather than all of them).

    I can't quite figure out how to do a formula that will combine a sum of each person's purchases, and then count the number of people in the data where their sum is greater than once.

    Any help would be much appreciated !
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Calculating the number of people who have purchased more than once, over rolling perio

    One way:

    =LET(A,B3:D10,B,BYROW(A,LAMBDA(x,COUNTIF(x,">0"))),ROWS(FILTER(B,B>1)))
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Contributor
    Join Date
    05-09-2019
    Location
    South West
    MS-Off Ver
    365
    Posts
    113

    Re: Calculating the number of people who have purchased more than once, over rolling perio

    Hi Glenn,

    Thanks for taking the time to look into this.

    I noticed that when I drag the formula in the example across, when I get to cell D18, it's only returning a value of 2, rather than 3 (I've highlighted this in the attached).
    In this example, the person made 2 purchases in May (rather than 1), so I'm not sure if this is throwing the formula off?

    Apologies, when I put the example together, I just put in 1s quickly, but a person could make more than 1 purchase in a month.
    Attached Files Attached Files

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Calculating the number of people who have purchased more than once, over rolling perio

    I'm about to board a flight. Just check that in the other places it is selecting the correct range.

  5. #5
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: Calculating the number of people who have purchased more than once, over rolling perio

    Try this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  6. #6
    Forum Contributor
    Join Date
    05-09-2019
    Location
    South West
    MS-Off Ver
    365
    Posts
    113

    Re: Calculating the number of people who have purchased more than once, over rolling perio

    Hi Jacc,

    That's perfect !!! Thanks so much ! Just to check, where you have the letter "t" in the formula, is that just a letter assigned to a parameter, rather than "t" meaning a particular function of it's own?

  7. #7
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: Calculating the number of people who have purchased more than once, over rolling perio

    It's just a random letter that is required in the Lambda function. Internally in the lambda function it represents a row.

  8. #8
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: Calculating the number of people who have purchased more than once, over rolling perio

    The formula written slightly differently:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    05-09-2019
    Location
    South West
    MS-Off Ver
    365
    Posts
    113

    Re: Calculating the number of people who have purchased more than once, over rolling perio

    Thank you so much everyone for all your help. I'd never have gotten the solution without your input, I really appreciate all the help

  10. #10
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: Calculating the number of people who have purchased more than once, over rolling perio

    Glenn, I see you often use REDUCE. Could it be used here? I tried and it didn't work but then again I never used it.

  11. #11
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: Calculating the number of people who have purchased more than once, over rolling perio

    Thanks for the feedback and rep . Glad to have helped.

    The formula can be written with the REDUCE statement, but that is not obvious or useful in this case.
    This creates a contrived solution:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  12. #12
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: Calculating the number of people who have purchased more than once, over rolling perio

    Thanks Hans, it was nice to get that confirmed! Pretty much what I tried to do but couldn't.
    Yeah it looks a little awkward but it's not that bad.

  13. #13
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: Calculating the number of people who have purchased more than once, over rolling perio

    You are Welcome!

    Thanks for the feedback and glad to have helped.

    If you haven't already, please consider adding reputation to all helpers you think they deserve.
    In that case please click * Add Reputation left below their answers.

+ 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. Formula to show how much people owe each other for gifts purchased?
    By JimmyWilliams in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-01-2022, 12:02 AM
  2. Replies: 13
    Last Post: 05-20-2020, 01:53 PM
  3. Replies: 6
    Last Post: 11-25-2012, 04:57 AM
  4. Calculating Number of Days for job length periods
    By Joe B in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 03-17-2009, 10:19 AM
  5. Calculating number of people
    By Denise in forum Excel General
    Replies: 2
    Last Post: 01-10-2006, 01:55 PM
  6. [SOLVED] Calculating number of periods when payment amount changes
    By Dan Patrick in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  7. Calculating number of periods when payment amount changes
    By Gary L Brown in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 04:05 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