Sum Specific cells if match criteria in another cell

arnorian

New Member
Joined
Aug 26, 2013
Messages
19
Hi,

I have over 8000 line excel report which lists all items in a quotes. I need to add column for "Extended List Price" only for the lines that are for the same quote

Example: I need for the code to be able to scan my report and average the discount % but only for the same quotes . Currently My code would have added up and averages all the Discount % listed below.

Quote NumberExtended AmountExtended Amount Net of IncentiveDiscount %Discount for Entire Quote
00400318$280000$14000050%
00300418$400000$20000050%
00300418$500000$25000050%
00300418$600000$6000090%
00300418$25000$0100%(50+50+90+50+100)/5 = 68%
12345678$280000$14000050%

<tbody>
</tbody>
















Thank You
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
You show five %s for quote number 00300418, but the data shows only four.

Anyway, maybe in E2 copied down...

=IF(A2<>A3,SUMIF($A$2:$A$8000,A2,$D$2:$D$8000)/COUNTIF($A$2:$A$8000,A2),"")
 
Upvote 0
Hi,

Sorry looks like I copied "50" an extra time.

Let me try that and see if that works.

Thank You
 
Upvote 0
Actually, I should have just gone with...

=IF(A2<>A3,AVERAGEIF($A$2:$A$8000,A2,$D$2:$D$8000),"")
 
Upvote 0
Hi arnorian
Welcome to the board

I'm sorry but your post does not make any sense to me. What is the meaning of adding the discount % and averaging it?

The way you have it, if you buy $1 and get 90% discount, and then $1,000 and get 10% discount, then (90%+10%)/2, you have on average 50% discount. Does this make sense to you?
 
Upvote 0
Hi pgc01,

Well what I'm really trying to accomplish is to find a code that can scan my file and then if Quote Numbers match then add all of the List Prices and Discounted Final Prices then calculate "Final Discount" provided. (There are some instances of 1 time discount thats being applied after standard discounts are used.

Problem that I'm running into is finding code that will match Quote Numbers for the entire 8000 lines of the report.
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,380
Members
449,080
Latest member
Armadillos

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