AverageIFS formula where values that have the same identifier need to be counted as 1

rwille

New Member
Joined
Sep 29, 2022
Messages
4
Office Version
  1. 2019
Platform
  1. Windows
I have a dataset of sales data and I need to find the average order value of all customers. If I take the average of all orders the average is lower than expected. This is because a customer will make a large purchase one day and then maybe a smaller purchase a week later and the average formula thinks its two different customers.

So I'm trying to sum the sales values if the client ID is the same and then count is as one. And if there isnt a repeat customer, still use that value in the average.

Say you have a dataset like this:
ID Sales Value
A1 $1000
A2 $2000
A1 $100
A3 $4000


I want the formula to sum the two values of A1 but only count it as one observation. so the average should be $7100/3, not $7100/4

pls help
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Try basing a formula on the principle of

=SUM(sales)/SUM(1/COUNTIF(ID,ID))

Or

=SUM(SALES)/ROWS(UNIQUE(ID))

The second one will be more efficient but will not work if you have excel 2019 or older.
 
Upvote 0
Welcome to the MrExcel Message Board!

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: AverageIFS formula where values that have the same identifier need to be counted as 1
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0

Forum statistics

Threads
1,215,403
Messages
6,124,710
Members
449,182
Latest member
mrlanc20

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top