Copy and Replace with Vlookup Formula

vbanoob1234

New Member
Joined
Aug 8, 2016
Messages
26
Hello everyone,

My goal is to find all YELLOW highlighted cells that are currently empty, and replace it with a vlookup formula like this:
=Vlookup(A1,A:Z,2,False)

The issue is when you use the Find and Replace function, the lookup value of A1 is an absolute value. I need the lookup value to be relative.
Eg.
A1 =Vlookup(A1,A:Z,2,False)
A2 =Vlookup(A2,A:Z,2,False)
A3 =Vlookup(A3,A:Z,2,False)
A4 =Vlookup(A4,A:Z,2,False)

The reason why I am asking this, is because my goal is to put a vlookup on every other line in one specific column. However, there are subtotals in the way. That is why I can't copy and paste the formula, because it will override my subtotal (sum) formula.

Thank you in advance
 
Hi Jonmo1

Thanks for your quick response. No unfortunately not. That is how the format looks like:

highlight blank cell (want a vlookup)
blank
Subtotal - sum formula 1 thing
blank
blank
blank
highlight blank cell (want a vlookup)
blank
highlight blank cell (want a vlookup)
blank
Subtotal - sum formula 2 things
blank
blank
blank
highlight blank cell (want a vlookup)
blank
highlight blank cell (want a vlookup)
blank
highlight blank cell (want a vlookup)
blank
Subtotal - sum formula 3 things

<colgroup><col><col span="4"></colgroup><tbody>
</tbody>
 
Upvote 0

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
In that case the method I've described won't work, it will select ALL the blank cells, not just the blank AND highlighted cells.

HOW are the cells highlighted?
Are they yellow via conditional formatting?
Or just randomly selecting a few cells and using standard cell fill color?
 
Upvote 0
It is just selecting a few lines, and using standard cell fill colour. thanks
Why not put the vlookup in 'during' your process of selecting which cells to highlight by hand?
Once you pick the first cell to highlight...
Put in the formula for that cell
Make sure to use appropriate absolute referencing in that formula.
i.e. =VLOOKUP(A1,$A:$Z,2,FALSE)
Highlight it yellow
COPY that cell

Now each cell you choose to highlight, just right click / paste.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,095
Messages
6,128,794
Members
449,468
Latest member
AGreen17

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