Countif

Deano

Active Member
Joined
May 2, 2004
Messages
264
Hi

Assuming I have a file with many rows or product codes and want to count the number of times each product code is duplicated and insert this value into a column in the data, I would use the COUNIF formula. Now if I want this to be modified to only count the visible rows when I apply filtering, can anyone tell me how to modify my formula?

Regards
 

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.
Hi

Assuming I have a file with many rows or product codes and want to count the number of times each product code is duplicated and insert this value into a column in the data, I would use the COUNIF formula. Now if I want this to be modified to only count the visible rows when I apply filtering, can anyone tell me how to modify my formula?

Regards

=SUMPRODUCT(SUBTOTAL(3,OFFSET(F5:F600,ROW(F5:F600)-ROW(F5),,1)),--(F5:F600=ProdCode))

Adjust the range to suit.
 
Upvote 0
Hi Fazza

I thought of this, but using the subtotal within the rows of data seems a bit tough? I normally use subtotal(3,etc) outside the "database" and not inside it. What's your suggestion??
 
Upvote 0
Hi Deano,

I didn't initially understand about wanting the result within the data - I thought/assumed it was at the bottom. So, please disregard my suggestion.

FWIW, it does sound though that inputs and reporting are being mixed up together. If there is significant data or the reporting becomes too difficult, you might consider having a dedicated data input section and a separate output/report section.

Beer o'clock for me. Regards, Fazza
 
Upvote 0

Forum statistics

Threads
1,214,387
Messages
6,119,208
Members
448,874
Latest member
Lancelots

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