Formula to count a specific value within a range of cells in a table

Vonsteiner

New Member
Joined
Apr 14, 2014
Messages
45
Office Version
  1. 365
Platform
  1. Windows
Okay, so I have a table with the following sample info. In column A I have an ID. There could be multiple duplicates or there could just be one. These IDs will run from cell A5 to probably no more than A10000. I have another column for a fee that is charged to each ID. If there are multiple IDs the fees needs to be spread out over all the IDs.

Column A
1001
1001
1001
1001
1002
1003
1003
1004
1004
1004
1004
1004
1005
1006
1007
1007
1008
etc...

So the fee of $100 needs to be broken out evenly between each ID. So for ID 1001 the fee would be $25 per row where 1001 shows up in A. $100 for 1002 since there is only 1 ID of 1002 and so on. I would like to input a formula into the table that would capture this data. I was thinking of using countif and index was haven't been able to get it to work yet. Any help would be greatly appreciated.

Michael
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Give something like this a try...

=100/COUNTIF(A$5:A$10000,A5)

where you would change the red highlighted 10000 to a row number guaranteed to be equal to or greater than the row number of your last data item.
 
Upvote 0
Solution
Hi,

May be you mean this:


Book1
ABCDE
4IDIDsFee
51001251001100
61001251002100
71001251003500
810012510041000
910021001005300
1010032501006400
11100325010072000
12100420010081200
131004200
141004200
151004200
161004200
171005300
181006400
1910071000
2010071000
2110081200
Sheet90
Cell Formulas
RangeFormula
B5=VLOOKUP(A5,D$5:E$12,2)/COUNTIFS(A$5:A$10000,A5)


Formula copied down, adjust cell references/range as necessary.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

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