The LOOKUP function behaviour

The VLOOKUP function behaviourโ€ฆ
HI! I am detecting an extrange behaviour with the VLOOKUP function. To place some context, I am applying a format rule to alert the user that a certain value (weight) he introduced in a form is higher or smaller than expected. To do this, the system looks for the product id (an ugly concatenation of product,units and length) in a reference table to compare the value with a max and min value.
Well, the question is that when you use this alert system in google spreadsheets, there is no problem. If the product id is not found in the reference table, it just gives โ€œN/Aโ€. But inside appsheet, I see that VLOOK funtion aparently gives a numeric value equal to โ€œ0โ€. So the โ€œalertโ€ is always displayed if the product id is new, for example for a particular package with less units than usual.
Well, the question is easily solved with a and([value]<>โ€œ0โ€;โ€œtheVLOOKformulaโ€), butโ€ฆ Am I right? is that the normal VLOOK behaviour?

0 7 368
7 REPLIES 7

Thatโ€™s not a normal behavior, it should give you a blank value if the record is not found. May I ask what kind of LOOKUP() are you using?

Steve
Platinum 4
Platinum 4

AppSheet doesnโ€™t have a VLOOKUP() function.

I am sorry, VLOOKUP is a mistake, I meant lookup.
The function was:
[Peso]>LOOKUP([Resumen];REF2;Grupo;maximo)
โ€œPesoโ€ (weight) is the input value. โ€œresumenโ€ is the product id. โ€œRef2โ€, the reference table, โ€œGrupoโ€ is the product id in the reference table, and โ€œmaximoโ€ is the max admissible value for โ€œpesoโ€. If The Lookup function is unable to find the โ€œresumenโ€ value in the column โ€œgrupoโ€ (for example, it happens when we have a new product), instead of not throwing any result for the exression, it returns the value โ€œTRUEโ€. Thats why I supposed that the lookup expression gives โ€œ0โ€. โ€œPesoโ€ is always bigger than zero.
In fact, I placed the expression:
and([Peso]>LOOKUP([Resumen];REF2;Grupo;maximo);LOOKUP([Resumen];REF2;Grupo;maximo)<>0)
This way, I โ€œforceโ€ a โ€œfalseโ€ value if the lookup expression gives a โ€œ0โ€, and then the function works as I expect it to.

See Troubleshooting here:

I have two tables. One for a quote and one for the data. For the quote, I want to look up a specific value in the data table. I have an enum field to choose between 2 options. If the first option is selected then the dependent field will automatically change to the column in the data field. However, if the second option is highlighted, then I want to use that same value but divide it by 2. I tried using an IFS() and data[column] expression but that didnโ€™t work.

Let me see if I understand you. You have a table โ€œquoteโ€ (with a column you want to lookup, called [product], for example, and an [enum] column with"option1" and โ€œoption2โ€), and a โ€œreferenceโ€ table (with column [data] and column [value]).
Well to do what you ask for (select a product, lookup for its โ€œvalueโ€, and if I choose the โ€œoption1โ€ I get the โ€œvalueโ€, but if I choose โ€œOption2โ€, I got the same value but halved) I think I would use, in a column โ€œresultโ€:
=ifs([enum]=โ€œoption1โ€;lookup([product],reference;data;value;[enum]=โ€œoption2โ€;(0.5lookup([product],reference;data;value)))
(note that you cannot type "0.5
value" inside the lookup expresion).

Thank you! I did something similar and it worked!

Top Labels in this Space