MATCH function workaround - nesting ADDRESS function?

1. MATCH function workaround - nesting ADDRESS function?

Hi clever people,

I was feeling all very smug with myself until I came across this problem!

I have a sheet (attached to this post) which essentially gathers the scores of a psychological assessment and then returns some indications on what the scores may mean.

There are 15 component scores and these are labelled A to O. The scores are entered manually and they range from 1-99%.

A part of the analysis process was to look at the top and bottom 5 scores and get the paragraphs of text that give an indication of what the score means. In this example the paragraphs of text are replaced by numbers 1 to 45 and are stored in the 'Data Interpretations' table at the bottom of the sheet.

In terms of identifying the top and bottom 5 scores I simply used the LARGE and SMALL functions which was fine, even if there were duplicate scores, this worked fine.

What I also needed was the equivalent component so I know which score this represented, and hence also get the correct interpretation text.

So, in the example spreadsheet in the Top 5, there are two components that have the same score of 95% - Components G and H. In the Bottom 5 there are again two components with the same score of 4% - Components C and N.

So, I used the follow equation to identify the component associated with the % score. (In this example we are looking at the Bottom 5 and rank number 4)

This finds the location of the corresponding component to the % score in the rank 1 to 5, depending on what ranking number is in row G (1 to 5), and then returns the address for that cell. Using INDIRECT I get the contents of the cell.

This is all good and fine, but I realised I had a problem when with duplicate scores, which I understand is a problem with the MATCH function, only finding the first occurrence. This led to the same components appearing twice in the list if there are duplicate scores. So in the first instance I created an IF equation which looks like this:

This effectively says, If the component returned is the same as the the one above, return "Duplicate", otherwise just return the answer - which works fine. I figured that you will only get a duplicate with the previous score, so by checking the previous cell you can be sure of knowing either way.

Now this is where I have hit a roadblock.

I figured that I could replace the "Duplicate" with a new INDREICT/ADDRESS/MATCH function that only searched for the next occurrence of the score in the range that came after the first occurrence. Eg. Cell + 1. So by passing the limitations of the MATCH function and just moving the search lookup array location to the cell after the first occurrence of the score through to the last cell as before.

So, for the Rank number 4 in the bottom, 5, this below function returns cell \$D\$12, which is the cell after the first occurrence of the 4% score. To achieve this I simply changed the +8 to +9 and 3 to 4 at the end of the equation.
I see this as identifying the start of the new range.

So, in the below equation, what I want to do is replace the \$D\$9 (which is the start of the whole range), with the (ADDRESS(MATCH(SMALL(\$D\$9:\$D\$23,4),\$D\$9:\$D\$23,0)+9,3)), thus starting the range after the first occurrence.

It would 'ideally' look like:

But I get an error - Not sure where to go with this and my eyes are going square looking at it. Can anyone please help?

Many thanks,

Mark

2. Re: MATCH function workaround - nesting ADDRESS function?

You are getting the NAs because you change the output in your Component to Duplicate - therefore when the other cells reference this Duplicate it can't find it in the row and returns NA.

I've attached a fix for you. Basically you need a column with unique scores which is accomplished by =D9+row()/100000. Then you just change your component look up equation to focus on this area of unique scores.

Hope this helps.

3. Re: MATCH function workaround - nesting ADDRESS function?

That all seems to work nicely - a lot more elegant. Thank you so much for your help.

To close this thread off and for anyone's future reference, with your fix, I removed the entire IF statement and was left with:

Many thanks,

Mark

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1