Seeking a formula to identify repeat customers

skemp
skemp
edited 08/21/24 in Formulas and Functions

I have a service metric to report how many repeat customers we have and I'm looking to build that via formula in a sheet summary. I have a Customer column that looks something like this:

Bob
Susan
Tim
Susan
Gina
Susan
Tim

If the formula works correctly it would return a result of of 2 as we have 2 repeat customers, Susan and Tim. I'm not looking to count the number of duplicate values, but rather to count the number of values that have duplicate entries.

I've tried several variations of COUNTIF, COUNTIFS, and IF statements to no avail. The AI formula generator hasn't been able to help either, unfortunately. I'd be thankful to anyone who can point me in the right direction!

Best Answer

  • DKazatsky2
    DKazatsky2 ✭✭✭✭✭✭
    Answer ✓

    Hi @skemp,

    Are you able to modify the sheet structure? If so, one way is to use a "helper" column to track the number of times a customer name is used (this column can be hidden). Next, your summary field can get a count of all the names that appear multiple times.

    The new column, which I called "Customer (Helper)" would have this formula:

    =COUNTIF(Customer:Customer, =Customer@row)

    The Summary field would then have this:

    =COUNT(DISTINCT(COLLECT(Customer:Customer, [Customer (Helper)]:[Customer (Helper)], >1)))

    Hope this helps,

    Dave

Answers

  • DKazatsky2
    DKazatsky2 ✭✭✭✭✭✭
    Answer ✓

    Hi @skemp,

    Are you able to modify the sheet structure? If so, one way is to use a "helper" column to track the number of times a customer name is used (this column can be hidden). Next, your summary field can get a count of all the names that appear multiple times.

    The new column, which I called "Customer (Helper)" would have this formula:

    =COUNTIF(Customer:Customer, =Customer@row)

    The Summary field would then have this:

    =COUNT(DISTINCT(COLLECT(Customer:Customer, [Customer (Helper)]:[Customer (Helper)], >1)))

    Hope this helps,

    Dave

  • @DKazatsky2 that worked perfectly! Thank you so much!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!