Forum Discussion
Jeremy_Pats
Nov 14, 2024Copper Contributor
Adding smallest 5 values
Good day, I am trying to add the 5 smallest numbers in a table range of selected columns. The numbers should range between 1 and 9 meaning that 0 should not be counted if it exists in any of the ...
m_tarler
Nov 15, 2024Bronze Contributor
Are those consecutive columns? so you could use the range operator ":"?
Here are a few options:
=SUM(AGGREGATE(15,2,1/(1/Table1[@[a]:[g]]),{1,2,3,4,5}))
=SUM(TAKE(SORT(IFERROR(1/(1/Table1[@[a]:[g]]),""),,,1),,5))
note the first will five an error if there are not at least 5 non-zero values while the second will just sum the non-zero values it does find.
if the columns aren't consecutive you may need to use HSTACK()
Jeremy_Pats
Nov 15, 2024Copper Contributor
Thanks. Let me give it a try. They are not consecutive. Where and how to I use HSTACK()?