E
E
Evgenia Satonina2021-01-12 00:48:26
Google Sheets
Evgenia Satonina, 2021-01-12 00:48:26

IFERROR in google sheets. Why, if the first value is selected, the second one is not checked anymore?

Good afternoon.
In my opinion, I have a complex PPC formula in the table. When I did it, I went nuts with myself ... But something does not work as it should ...

The bottom line is this. There is a table, there are two sheets. On one price and model, on the other order form.
In the form you enter the model, the table automatically substitutes the price, from the second sheet.
There are several model options. The option is selected with a checkmark. If the checkbox is checked, then another price is pulled up.
Attention question:
If I put two ticks, then the price is pulled up on the first one, but not on the second one.

In practice:
Dresser model: No. 001, hinges with closers (tick), illuminated hinges (tick).
There are four prices on the price sheet.
Price per chest of drawers 001
Price for chest of drawers 001 with hinges with door closers
Price for chest of drawers 001 with hinges with light
Price for chest of drawers 001 with hinges with door closers and with light.

So, if in the order form I check both the door closers and the backlight, then the price is selected only for the door closers, and the second checkbox is ignored. Below is the formula in a cell...

=IFS(I5 = TRUE, iferror(QUERY(Pricelist!$A:$R,"select R where A like '"&$D5&"'",0),""),
 I6 = TRUE, iferror(QUERY(Pricelist!$A:$S,"select S where A like '"&$D5&"'",0),""),
 I7 = TRUE, iferror(QUERY(Pricelist!$A:$T,"select T where A like '"&$D5&"'",0),""),
 K6 = TRUE, iferror(QUERY(Pricelist!$A:$U,"select U where A like '"&$D5&"'",0),""),
 1*1=1, "")


It is necessary to somehow make it so that if two checkmarks are selected, then choose the price according to the last one .... The question is, how? =) I hope I explained clearly....

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Ivanov, 2021-01-12
@Jazzcool

The bottom line is that the decision queue IFSis characterized by linearity, which boils down to the principle "who is the first, that is the decision." That is, if you change the lines in this way, then you will get the desired result

K6 = TRUE, iferror(QUERY(Pricelist!$A:$U,"select U where A like '"&$D5&"'",0),""),
I5 = TRUE, iferror(QUERY(Pricelist!$A:$R,"select R where A like '"&$D5&"'",0),""),
I6 = TRUE, iferror(QUERY(Pricelist!$A:$S,"select S where A like '"&$D5&"'",0),""),
I7 = TRUE, iferror(QUERY(Pricelist!$A:$T,"select T where A like '"&$D5&"'",0),""),

5ffd7efa79ac2644845990.png
Unfortunately, when solving such problems, linearity is not always cool, because any unconditional transition is more often a bad thing than a good thing.
The ideal solution can be assumed to be a selector: this is when all solutions have single-valued weights, regardless of the queue.
  • I5 = TRUE- This1
  • I6 = TRUE- This2
  • I7 = TRUE- This5
  • K6 = TRUE- This9

You need to check if the sum of all checks 1, then only includes I5, if 3- I5and I6, if 12- I5and I6and K6etc. Now you can choose the solution to your taste - you know all the options.

A
Alexander, 2021-01-12
@ForestAndGarden

The formula is written for radio boxes, not check boxes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question