I need to find the most popular medication codes in a range of data.
I'm trying to use this formula:
=IF(COUNTA(S$1:AI$1306)<10,0,INDEX(S$1:AI$1306,MODE(MATCH(S1$1:AI$1306,S$1:AI$1306,0)+{0,0})))
which, up until now, when used as an array, has been listing the most popular values within a column in succession
but it's giving me an #N/A value. I have three hypotheses:
1) It's because #N/A values exist in that range
So I did a find and replace to change all the #N/A values to a fake med code.
That didn't fix the problem
2) It's because there's these "." to indicate blank data (no med codes) in this range.
So, I did a find and replace to change all the "." to a fake med code, but that didn't fix the problem either.
3) It's because I'm using this formula on a range of data, rather than simply a column.
I don't know how plausible this is. And It'd be a lot of work to test this one.
So I thought I'd throw it out there, with the hope that you guys might have something to suggest. All suggestions are welcome and appreciated.
Thank you.
Bookmarks