Forum Discussion
Thaddaeus
Nov 24, 2024Copper Contributor
Numeric range conversion
As part of survey data, I have an Excel column that is a numeric range for the time each respondent commutes (in minutes): 1-5, 6-10, 11-15, 16-20, 21-25, etc. up to 85-90, 90+. This was a mistake as I ended up needing a single number in order to calculate correlations.
Does anyone have a formula for converting a numeric range to a single digit average? Such as 16-20 being converted to 18 and so on? Thank you!!!
3 Replies
- ThaddaeusCopper Contributor
Thank you so much!!!
- PeterBartholomew1Silver Contributor
To add some more 365 options you could have
= MAP(numericRange, LAMBDA(r, AVERAGE(VALUE(TEXTSPLIT(r, "-"))) ))
or, using a named Lambda function to simplify the worksheet formula,
= MAP(numericRange, RangeAverageλ) RangeAverageλ = LAMBDA(r, AVERAGE( VALUE( REGEXEXTRACT(r,"\d+", 1) ) ) );
- Harun24HRBronze Contributor