Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to convert a column of age counts into a set useful for statistics?

I’ve got a column of ages and a column of the count of those ages. I need these to be transformed into a set that I can run statistical functions like average on. For example:

Age Count
14 2
16 1
17 3

This needs to become (14,14,16,17,17,17) so that I could use =average or =stddev more easily on it. I have figured out a workaround to calculate average based off the formula but am stuck on standard deviation. There is probably a simple solution but I’m unable to find it on google.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Try using the following formula:

enter image description here


• Formula used in cell D2

=XLOOKUP(SEQUENCE(SUM(B2:B4)),SCAN(0,B2:B4,LAMBDA(x,y,x+y)),A2:A4,,1)

Or,

enter image description here


• Formula used in cell D2

=TEXTSPLIT(TRIM(CONCAT(REPT(A2:A4&" ",B2:B4))),," ")/1

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading