I need Vlookup not to show #N/A in cells where the source file doesn't yet exist.

SandsB

Well-known Member
Joined
Feb 13, 2007
Messages
705
Office Version
  1. 365
Platform
  1. Windows
I have rows of data from a VLOOOKUP that gets data from daily source files except the files aren't created on Sundays or for the dates we haven't reached yet. (So on 8/1 I get data for 8/1 but every other day for the current month shows #N/A)

=VLOOKUP($A6,'J:\InputFiles\[Daily_Stats 08-01-2022.xlsx]Sheet1'!$A$1:$D$74,4,FALSE)*29
=VLOOKUP($A6,'J:\InputFiles\[Daily_Stats 08-02-2022.xlsx]Sheet1'!$A$1:$D$74,4,FALSE)*29
=VLOOKUP($A6,'J:\InputFiles\[Daily_Stats 08-03-2022.xlsx]Sheet1'!$A$1:$D$74,4,FALSE)*29
=VLOOKUP($A6,'J:\InputFiles\[Daily_Stats 08-04-2022.xlsx]Sheet1'!$A$1:$D$74,4,FALSE)*29
etc

I have monthly tabs to get all this data and it all works fine but every month I have to edit the file and remove the formulas for Sundays and even then I still have an ugly report for the days still in the future. How can I code the same formula so if the source file doesn't exist yet the formula just returns a blank?
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
One option could be to wrap it with IfError:
Excel Formula:
=IFERROR(VLOOKUP($A6,'J:\InputFiles\[Daily_Stats 08-01-2022.xlsx]Sheet1'!$A$1:$D$74,4,FALSE)*29,"")
 
Upvote 0
try
Excel Formula:
=IFERROR(VLOOKUP($A6,'J:\InputFiles\[Daily_Stats 08-01-2022.xlsx]Sheet1'!$A$1:$D$74,4,FALSE)*29,"")
 
Upvote 0
The IfError version is often used for "VLookup not found" but in your case you are also multiplying by 29 and it will also hide an error where the VLookup returns a text value. If you don't want that then use IFNA instead.
Excel Formula:
=IFNA(VLOOKUP($A6,'J:\InputFiles\[Daily_Stats 08-01-2022.xlsx]Sheet1'!$A$1:$D$74,4,FALSE)*29,"")
 
Upvote 0

Forum statistics

Threads
1,215,048
Messages
6,122,862
Members
449,097
Latest member
dbomb1414

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