Nov 20 2023 12:30 AM
Trying to make a small project. I was able to get Distinct Values (B25:B29), but not able to get the number of times (Count) matching the values. Need help.
Nov 20 2023 02:45 AM
= LET(
distinctLine, SORT(UNIQUE(Line)),
count, COUNTIFS(Line, distinctLine),
HSTACK(distinctLine, count)
)
Nov 20 2023 04:19 AM - edited Nov 20 2023 04:52 AM
Appreciate your help. Being novice, literal beginner in Excel, can I ask to fill in the blanks here...
=LET(
B25, SORT(UNIQUE($B$12:$B$23)),
count, COUNTIFS($B$12:$B$23, B25),
HSTACK(B25, count)
)
Nov 21 2023 08:45 AM - edited Nov 21 2023 08:47 AM
The LET function requires that the first parameter defines the name of the variable that stores the value returned by the second parameter for further use. B25 is illegal as a name because it conflicts with the notation that is used to identify a worksheet cell. If you replace your reference by a name such as I used (both where it is defined and where it is used) then the formula should evaluate correctly to return a spilt range.
The return the result to cell B25 you must write the formula in that cell. If you write the formula somewhere else, that is where the result will be returned.
BTW: My formulas may look unfamiliar because I never use the cell location (A1 etc.) to reference data directly I always apply a Range Name that attempts to reflects the business context rather than the location on the sheet.