Vlookup column reference is last filled column in a row?

IndependentHope

New Member
Joined
Jul 17, 2014
Messages
4
Good evening and thanks for looking at this and possibly helping me out.

Currently, I have a standard vlookup forumla that looks like =Vlookup(B2,Sheet2!A:G,5,false)

However, the data on sheet two is ever expanding--each month, specifically. And I need to return the most recent (so, rightmost filled) column. Right now, the column is 5, but next month it will be 6 and so on and so forth.

I'm only a moderate Excel user...nowhere near wizard status. I have exactly no experience with VBA and basically learn formulas via Google when I need to figure something out. But Google doesn't seem to follow what I'm asking. But this forum has helped me with about a gazillion other Excel problems, so I figured I'd give posting this issue specifically.

Thanks for all your help!
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
What is your VLOOKUP formula supposed to return - a text or numeric value? And in which row starts the table data (including the headers) in Sheet2?
 
Upvote 0
What is your VLOOKUP formula supposed to return - a text or numeric value? And in which row starts the table data (including the headers) in Sheet2?

It is supposed to return a number--the total count of monthly "tallies" for that client. Including headers, the data starts in row 1.
 
Upvote 0
The 'easy' solution (though definately not the 'best' solution)

=Vlookup(B2,Sheet2!A:G,COLUMNS(Sheet2!A:G),false)

Now if you want to accomodate for adding a new column at say H, and the formula should change to cover A:H
=Vlookup(B2,Sheet2!A:H,COLUMNS(Sheet2!A:H)-1,false)
Note, this is intended to be for the original formula going from A:G
 
Upvote 0

Forum statistics

Threads
1,223,275
Messages
6,171,127
Members
452,381
Latest member
Nova88

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