Appending a total to the end of a UNIQUE list

TonyD1016

Board Regular
Joined
Nov 18, 2021
Messages
59
Office Version
  1. 365
Platform
  1. Windows
Following up from this thread, I am wondering if it is possible to take this formula to create essentially a dynamically updating table as new counties appear.
Excel Formula:
=LET(u,UNIQUE(SORT(County)),CHOOSE({1,2},u,COUNTIFS(County,u)))

This searches an existing list for time time a particular county appears then displays the results as:

County1 AMT
County2 AMT
County3 AMT

...and so on.

What I would like to do is append the word "Total" to the bottom of the list of counties and in the column next to it use a =SUM(COUNTIFS(County,UNIQUE(County))) to display the total number of times all counties have appeared.
So I would end up with :
County1 AMT
County2 AMT
County3 AMT
Totals SUM
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Personally I would stick to having the two formulae you had before & put them in row 2 (say D2& E2) then put the word Total in D1 & in E1
Excel Formula:
=SUM(E2#)
 
Last edited:
Upvote 0
Here's how I do something similar. Maybe you can adapt it.

 
Upvote 0
However if you want it as part of the spill range try
Excel Formula:
=LET(u,UNIQUE(SORT(county)),c,COUNTIFS(county,u),s,SEQUENCE(ROWS(u)+1),IFERROR(INDEX(CHOOSE({1,2},u,c),s,{1,2}),CHOOSE({1,2},"TOTAL",SUM(c))))
 
Upvote 0
Solution
Kind of an odd formulation, but this also works:

Excel Formula:
=IFERROR(SORT(UNIQUE(CHOOSE({1,2},County,COUNTIF(County,IFERROR(INDEX(County,SEQUENCE(ROWS(County)+1)),"*"))))),"Total")
 
Upvote 0

Forum statistics

Threads
1,214,611
Messages
6,120,513
Members
448,967
Latest member
screechyboy79

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