using xlup function within a formula to select your range

jufglanville

New Member
Joined
Sep 11, 2017
Messages
23
Can you use the xlup function in a vba formula? I am using the below formula, however I want to try and change the R[-52] to xlup and the R[-51] to xlup and offset one down, is this possible?


Code:
TaxCode4.FormulaR1C1 = "=IF(LOOKUP(2,1/(R[-52]C:R[-1]C<>"" ""),(R[-51]C[-1]:RC[-1]))="""",LOOKUP(2,1/(R[-52]C:R[-1]C<>"" ""),(R[-52]C[-1]:R[-1]C[-1])),LOOKUP(2,1/(R[-52]C:R[-1]C<>"" ""),(R[-51]C[-1]:RC[-1])))"
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Just do the last row calculation before this line, and use the variable in your formula (note that the variable needs to be outside the double-quotes, so you will need to combine the literal text part and variables with "&"s).
If you do that though, you will probably need to change your formula, as it is currently using R1C1 formula referencing
 
Upvote 0

Forum statistics

Threads
1,222,689
Messages
6,167,647
Members
452,127
Latest member
jayneecm

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