Formula to Vlookup and if error (#N/A) return value of the cell two to the right

Knockoutpie

Board Regular
Joined
Sep 10, 2018
Messages
116
Office Version
  1. 365
Platform
  1. Windows
Hey everyone, long time browser, and i've been able to find many of my answers to questions on here. However i'm having one question stop me in my tracks.

How can i get IFERROR or something similar to return the value of the cell in column P

My vlookup is as follows

Range("M2").Select
ActiveCell.FormulaR1C1 = "=CONCATENATE(RC[-6],RC[-5],RC[-3])"

Or can be translated as

=VLOOKUP(M2,'[Common Report_Inv.xls]Common Report_Inv'!$K:$L,2,FALSE)

I'm trying to get it to when there is #N/A it will then return the value of the cell to the right (column P)

The result of the vlookup returns the value to M. But occasionally it will return an Error (#N/A) because no matching results are found. I would like it to return the value of two cells to the right in P.

Thanks for any help, i'm able to answer questions to clarify further :)
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Do you mean something like this?

Code:
=IFERROR(VLOOKUP(M2,'[Common Report_Inv.xls]Common Report_Inv'!$K:$L,2,0),P2)
 
Last edited:
Upvote 0
Do you mean something like this?

Code:
=IFERROR(VLOOKUP(M2,'[Common Report_Inv.xls]Common Report_Inv'!$K:$L,2,0),P2)

So simple..

Thank you! Looks like my IfError formula was referencing a value to input on error and not a cell value

Guess I shouldn't have used " "
=IFERROR(VLOOKUP(M2,'[Common Report_Inv.xls]Common Report_Inv'!$K:$L,2,0),"P2")
 
Upvote 0
Is there any chance you can also have the formula specify IF NULL then return value of P2? I know it's quite a few arguments in this formula already. The formula you provided works great for no value (#N/A) returned, but occasionally there will be NULL in the field instead of an N/A
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

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