Syntax error using a VLOOKUP formula from Excel in Numbers

Hi,

I'm in the process of transferring an Excel file to Numbers and am having issues with one last formula.


I've tried various different iterations but am still coming up with a Syntax error, can anyone advise what I might be doing wrong please?


This is the original formula from Excel;


=VLOOKUP($I2&$J2;CHOOSE({1\2};Rates!$C$5:$C$219&Rates!$D$5:$D$219;Rates!$E$5:$E$219);2;FALSE)*K2


Alternatively, does anyone know of a way to establish exactly which part of the formula is causing the issue? From what I can tell, the Search Criteria and Range References are correct (as they are highlighted in the different sheets).


Thanks in advance for any guidance you might be able to provide.

iPhone 15, iOS 18

Posted on Jan 24, 2025 3:13 AM

Reply
6 replies

Jan 24, 2025 7:23 AM in response to LIBeaky

Since a particular Level-Country pair will occur only once you can use SUMIFS, like this:




=SUMIFS(Rates::D;Rates::B;B2;Rates::C;C2)*D2


AVERAGEIFS or MAXIFS or MINIFS would also work.


If you don't usually have your region set to English note that in Numbers you can go to File > Advanced > Language and Region... and change the region and language to input the formula and then switch back to the language you prefer to use in Numbers. That way you can see that In German the formula would be:


=SUMMEWENNS(Rates::D;Rates::B;B2;Rates::C;C2)*D2


etc.


SG


Jan 24, 2025 3:35 AM in response to LIBeaky

Not sure exactly what that formula is doing. My guess is part of the problem is with CHOOSE({1/2} and that it's a form of "array" formula that Numbers can't support.


There are usually workarounds in Numbers, often more understandable than the original.


If you post a screenshot and show what it is doing then someone here can make suggestions.


Note, BTW, that VLOOKUP is old. Use XLOOKUP. It's easier, and more flexible.


Also note that in Numbers you typically wouldn't use something like $C$5:$C$219. You would use $C, referring to the entire column rather than a range within it.


SG

Jan 24, 2025 6:54 AM in response to SGIII

Thank you @SG.


Formula:

=VLOOKUP($I2&$J2;CHOOSE({1\2};Rates!$C$5:$C$219&Rates!$D$5:$D$219;Rates!$E$5:$E$219);2;FALSE)*K2


This resides in column L 'Costs' (sheet labelled in pink ‘PROJECTS’), shown currently with the error.


It takes into account the combination of column I (Level) and J (Country). These fields can be selected from a dropdown and reference the separate sheet 'RATES' (columns C and D). 


Depending on which Level (C) and Country (D) are selected, column E (Euro) equals a different cost, eg. France, Level 10 the cost is 128,18€. This is the figure that needs to be referenced in column L (sheet ‘Projects’), and then multiplied by the figure in column K (‘Projects’).


Hopefully what I'm trying to do is understandable?







This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Syntax error using a VLOOKUP formula from Excel in Numbers

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