You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Need help with Numbers formula

Hi, I am having trouble writing what I thought was a simple Vlookup function.


Using Numbers for Mac, In one sheet, Column A there is of master order number (Main), and a second sheet (Remote) with order numbers in column A


I am trying to write a formula that will look at the order numbers in Remote then find the matching order number in Master, then put the matching number from Remote in column C in Master sheet. I pasted some dummy data to hopefully give an example of what I am hoping to accomplish.

Thank you in advance for any help, it is greatly appreciated.

MacBook Air 13″, macOS 14.7

Posted on Oct 29, 2024 2:08 PM

Reply
2 replies

Oct 29, 2024 4:09 PM in response to chris9771

This should be fairly easy, but without seeing your formula it's hard to tell what's wrong.


Given what you showed, the formula in Master::Table 1::C2 should be:


=VLOOKUP($A2,remote::Table 1::A:B,2,FALSE)


VLOOKUP() takes 4 arguments. The first is the value you want to lookup - in this case, cell $A2

The second argument is the range you want to search - this needs to include not only the ID column, but also the values (totals) column, so I have it set to columns A:B from Table1 on the 'remote' sheet ('remote::table1::A:B)

The third argument is which column you want to return the value from - in this case you want column B, or the 2nd column in the range, hence the '2'.

Lastly comes a TRUE/FALSE flag which toggles exact/closest match. In this case you presumably want an exact match, hence FALSE.


The mistake most people make with VLOOKUP is that they only include the search range as the second parameter, not the search-and-results range. That's where XLOOKUP is preferable, where you can specify distinct lookup and results ranges, as well as what to do for missing matches. A comparable XLOOKUP might say:


=XLOOKUP($A2,remote::Table 1::A,remote::Table 1::Order total,"MISSING ID",0,1)

Need help with Numbers formula

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.