VLOOKUP breaking a subsequent sum formula

Mattduk

New Member
Joined
Jan 17, 2025
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi all,

Firstly, thank you for allowing me to join your forum.

I have Vlookup formula...

=IFNA(VLOOKUP(A12,Sheet1!$D$28:$N$76,7),0)

it works, it returns that value. See below. It's looking for the GL code 301000 on this sheet in a table on a second sheet, then returning the data in the 7th column. Simple. The cell below it is a simple = of it.


1737118803707.png



So then I try to copy the same formula, to some cells below it.

1737118918683.png


Now, these codes don't exist in the second sheet yet. They will at some point later in the year, as more transactions happen in the books (the second sheet is a trial balance), but you can see here, the cell labeled PO-10-02 is returning #Value.

I'm stuck. I want this sheet that you can see here to be static, and unchanging. It contains all the possible GL codes. The table the vlookup is searching through will change from month to month as different types of accounting transactions take place. I will just adjust the size of the area the vlookup is searching as necessary and copy the formula down again.

So, how do I stop the results from the vlookup for cells who's GL code doesn't exist from breaking any sums that are referencing them?

Many thanks.
Matt
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
=IFERROR( you vlookup, "")

Not sure why you are not getting an N/A error

you are looking for the nearest value and not exact
=IFNA(VLOOKUP(A12,Sheet1!$D$28:$N$76,7),0)
try
=IFNA(VLOOKUP(A12,Sheet1!$D$28:$N$76,7,false),0)

Note: Images are difficult to see , and also requires that I input all the data myself, which means I may make an error, which is very time consuming, and from my point of view less likely to get a response, if a complicated spreadsheet. Plus we cannot see any of the formulas used.

Therefore -

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

This will possibly enable a quicker and more accurate solution for you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone
 
Upvote 0
Solution
Hi wayne,

Your first suggestion worked! Thank you so much, you have no idea how long I was scratching my head over this yesterday.

And I've noted your suggestions for next time.

Thanks again and have a super weekend!
Matt
 
Upvote 0

Forum statistics

Threads
1,225,626
Messages
6,186,090
Members
453,337
Latest member
fiaz ahmad

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