Change a search formula to return the cell reference of the value it finds

pbgexcel

New Member
Joined
Jan 2, 2018
Messages
26
Good afternoon all,

I have been using this formula:

=INDEX($J$2:$J$52609,MATCH(MIN(ABS($J$2:$J$52609-$Q$1)),ABS($J$2:$J$52609-$Q$1),0))

..to find the closest number in a large range ($J$2:$J$52609) to the number in Q1. Is there any way I can get the cell reference of the resultant number instead?

Thanks for your help!
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Since

=MATCH(MIN(ABS($J$2:$J$52609-$Q$1)),ABS($J$2:$J$52609-$Q$1),0)

gives you the row number-1, and you already know the column (10), combine with the address function to get a cell reference.
 
Last edited:
Upvote 0
Hi sheetspread,

Thanks for your help! So I tried:

=ADDRESS(MATCH(MIN(ABS('SHEET NAME'!$J$2:$J$52609-$Q$1)),ABS('SHEET NAME'!$J$2:$J$52609-$Q$1),0)+1,13,1,1,"SHEET NAME")
*(13 because I want column M)

...but to no avail. It returned #NA . I can't figure out why. Is this syntax correct? Thanks so much for your help!
 
Upvote 0
It's an array formula, that's why. Is there anyway to change the formula so it is calculable automatically?
 
Upvote 0
I don't see any obvious errors with the syntax. Try testing just the match part, then address(random number, 13,1,1,"sheet name").

Edit: Just saw your new post. If the ctrl-shift-enter is a problem for some reason, can you keep it in a separate cell from the address formula?
 
Last edited:
Upvote 0
Absolutely, in fact this is how I have it now. So I have the formula basically construct the reference as text in a cell off to the side. Is there some function I can use in another cell to take this cell reference as text and read it as if it were a formula?
 
Upvote 0
I just learned how to do this too, it's awesome :D Look up how to do OFFSET as well, it's super useful. You can use it to find a another cell next to the one you got the address from.
 
Upvote 0

Forum statistics

Threads
1,213,532
Messages
6,114,176
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top