Way to reference a modified range with single cell??

markgoolsbay

New Member
Joined
Aug 24, 2017
Messages
4
Hello,

I want to apply a formula that searches a range modified by another formula. For instance, if you had a column with some unimportant two-character prefix and you wanted to perform a VLOOKUP on the 5 trailing characters, is there a way to do so without first creating a separate column using the formula, =MID(text, 3, 5) ?

It would look something like this... =VLOOKUP( D1, MID(A:A,3,5) , 2 , FALSE)

A:A being the cells with the extra 2 character prefix, MID(A:A,3,5)being your modified range, and D1 being the matching cell after all cells in A:A range are trimmed.Thanks!


Mark
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
I would use an array formula for this:

{=INDEX(B:B,MAX(IF(MID(A:A,3,5)=TEXT(D1,"#"),ROW(A:A),0)))}
where B:B is the column you would like to return (in your formula it's represented by the 2 before the False)


To create an array formula, put this formula into a cell: =INDEX(B:B,MAX(IF(MID(A:A,3,5)=TEXT(D1,"#"),ROW(A:A),0))) Then double click in cell and press Cntrl+Shift+Enter. Brackets will appear around the formula to indicate this was done correctly.

Let me know if you have any questions!

-Max
 
Upvote 0
Haha idk why I didn't think of that! Tetra has a much more efficient solution than mine!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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