Count number of max values per unique value and column heading?

kim2109

New Member
Joined
Jul 26, 2024
Messages
3
Office Version
  1. 365
Platform
  1. Windows
This is a bit complicated to explain but I'll try my best.

I have column A with unique references per order. I have a formula to count how many unique values are in the column which is working well.
The next column (B) is a list of categories.
The next three columns are sales per category, with the headings of these columns corresponding to the categories listed in column B.

I need a formula to count the number of values in each category column, per each unique value in column A. I can do this!
The part I cannot do is, if a value in column A has two different categories in B, and then two separate values in M and N, I need it to only count which is highest in the total at the bottom.

I am stumped. I'm not averse to a helper column!
 

Attachments

  • Excel.png
    Excel.png
    20.8 KB · Views: 14

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Hi,

when you say "and then two separate values in M and N" - do we need to know whats in Col M and N ?
thanks
Rob
 
Upvote 0
Hi Kim,

I could only offer a solution by using 2 Helper columns as such :

Hope it helps

Rob

count_no_of_max_values.xlsx
ABCDEFGH
1Unique RefCategoryDepotWholesalerMultiplesBulkTotals
2aDEPOT170100017011
3bBULK000111
4NOT ON LIST00000#N/A
5dWHOLESALER014820014821
6dWHOLESALER000000
7eMULTIPLES002412024121
8fWHOLESALER016100016101
9fWHOLESALER000000
10fWHOLESALER000000
11gMULTIPLES002224022241
12gWHOLESALER018200018200
13hDEPOT204200020421
14iDEPOT6080006080
15iDEPOT104200010421
16jMULTIPLES002150021501
17
1893231FORMULA ANSWER
19
2093231CORRECT ANSWER
Sheet1
Cell Formulas
RangeFormula
G2:G16G2=MAX(C2:F2)
H2:H16H2=(G2=MAX(IF(A$2:A$17=A2,G$2:G$16)))*(SUM(IF(A$2:A2=A2,IF(G$2:G2=G2,1)))=1)
A18A18=SUMPRODUCT(--(ISTEXT(UNIQUE(A2:A16))))
C18:F18C18=COUNTIFS(C2:C16,">0",$H$2:$H$16,"=1")
 
Upvote 1
Solution
you're welcome, thanks for the feedback

Rob
 
Upvote 1

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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