Conditional Average

RAM

Well-known Member
Joined
Oct 4, 2004
Messages
1,862
I'm looking for a conditional Average in F17.
Book2
ABCDEFG
1Support columns
2Sales tax# of items
3Months in yearMonths in yearMonth of saleMonth of sale
41Jan6Jun8-Jun-077.25%71
52Feb6Jun15-Jun-076.60%75
63Mar1
74Apr1
85May1
96Jun1
107Jul1
118Aug1
129Sep1
1310Oct1
1411Nov1
1512Dec1
16Average Sales tax8 oz IA
176.93%146
Sheet1


Columns A:D are support columns and will be hidden.

G17 sums upp all items for June. I'm looking for the same function in F17 but and Average not a Sum. I have already added a formula in F17, but am a little uncertain it is a good formula.

What do you think? Any inputs?

RAM
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
I'm not quite sure why you need to get an average sales tax percentage but I think that if you do it that way you won't take account of the number of items calculated at each percentage. Perhaps

=SUMPRODUCT(--(D4:D15=B9),F4:F15,G4:G15)/G17
 

RAM

Well-known Member
Joined
Oct 4, 2004
Messages
1,862
I'm not quite sure why you need to get an average sales tax percentage

I know, it looks weird. I'm using it to pull up different accumulated monthly sales to my Profit and Loss sheet using lookups. The above Sheet1 is just a part of my Databas.

I do have different sales taxes for different states and during one month, sales might have happened in different states and the Profit & Loss sheet pulls up the total amount of sales, as in G17 above, for that month selected from the Combo Box in the Profit & Loss sheet. All sales is multiplied with the sales tax and if I have different sales taxes I'm looking at an Average will smooth it out and give me an difference of only a few cents.

Do you still think =SUMPRODUCT(--(D4:D15=B9),F4:F15,G4:G15)/G17 is the better choice?

Do you have a better idea than mine? It is a little rough, I know.

RAM
 

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
I think that my suggestion would be an improvement, because it takes account of the number of sales at each percentage, but to get a more accurate figure you'd need to factor in the actual sale values.
 

RAM

Well-known Member
Joined
Oct 4, 2004
Messages
1,862
but to get a more accurate figure you'd need to factor in the actual sale values.

Alright, I can add the sales price in the Databas too, not only in the Profit and loss sheet. I call upp all other sales info from the Databas and I can call upp the sales price too.

What do you think now?
Conditional Average.xls
ABCDEFGH
1Support columns
2Sales tax# of itemsRetail Price/item
3Months in yearMonths in yearMonth of saleMonth of sale
41Jan6Jun8-Jun-077.25%71$ 20.00
52Feb6Jun15-Jun-076.60%75$ 20.00
63Mar7Jul20-Jul-077.75%28$ 20.00
74Apr1 
85May1 
96Jun1 
107Jul1 
118Aug1 
129Sep1 
1310Oct1 
1411Nov1 
1512Dec1 
16Average Sales tax8 oz IA
176.92%146
Sheet1


RAM
 

Forum statistics

Threads
1,181,722
Messages
5,931,673
Members
436,798
Latest member
spprtpplcm

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
Top