0

I have database in Google Sheets, Let's say the named sheet is Chemical. In Sheet Chemical, I have data in the range Chemical!A:E as pictured below:

enter image description here

Then i have database in the range Chemical!G1:I10 as pictured below:

enter image description here

In column C, D, and E, I would like to classify using VLOOKUP based on categories from columns H and I. In the example, if the value of column A (Product Name) matches column G, then columns C, D, E will be filled based on the match between columns H and I. Example cell A7, Oxteril 250 LRA, if viewed database, Oxteril 250 LRA has Parameter 1: Acid and Parameter 2: H2O2. So, columns D and E are true because they match. Finally, the output in columns D and E is 4 each because Sampling Qty is 4.

Below is an example of my expected output based on the sample data above.

enter image description here

Before that, i have created formula and it worked (needs dragging formula). Following my formula in column C, D, and E:

Column C:

=IF(AND(VLOOKUP(A2; $G$1:$I$11;  2; FALSE) = "Base"; OR(VLOOKUP(A2; $G$1:$I$11; 3; FALSE) = "-"; VLOOKUP(A2; $G$1:$I$11; 3; FALSE) <> "-")); B2; if(AND(VLOOKUP(A2; $G$1:$I$11;  2; FALSE) <> "Base"; VLOOKUP(A2; $G$1:$I$11; 3; FALSE) = "Base"); B2; ""))

Column D:

=IF(AND(VLOOKUP(A2; $G$1:$I$11;  2; FALSE) = "Acid"; OR(VLOOKUP(A2; $G$1:$I$11; 3; FALSE) = "-"; VLOOKUP(A2; $G$1:$I$11; 3; FALSE) <> "-")); B2; if(AND(VLOOKUP(A2; $G$1:$I$11;  2; FALSE) <> "Acid"; VLOOKUP(A2; $G$1:$I$11; 3; FALSE) = "Acid"); B2; ""))

Column E:

=IF(AND(VLOOKUP(A2; $G$1:$I$11;  2; FALSE) = "H2O2"; OR(VLOOKUP(A2; $G$1:$I$11; 3; FALSE) = "-"; VLOOKUP(A2; $G$1:$I$11; 3; FALSE) <> "-")); B2; if(AND(VLOOKUP(A2; $G$1:$I$11;  2; FALSE) <> "H2O2"; VLOOKUP(A2; $G$1:$I$11; 3; FALSE) = "H2O2"); B2; ""))

My goals is i would like to use array formula without dragging. Before that, i have created formula using array formula but it not worked. As example following my formula in column C:

=ArrayFormula(IF(AND(VLOOKUP(A2:A; $L$1:$N$11;  2; FALSE) = "Base"; OR(VLOOKUP(A2:A; $L$1:$N$11; 3; FALSE) = "-"; VLOOKUP(A2:A; $L$1:$N$11; 3; FALSE) <> "-")); B2:B; if(AND(VLOOKUP(A2:A; $L$1:$N$11;  2; FALSE) <> "Base"; VLOOKUP(A2:A; $L$1:$N$11; 3; FALSE) = "Base"); B2:B; "")))

Please advise me how I can fix the formula to correct this sheet especially for column C, D, and E. Thankyou

1 Answer 1

0

You may try:

=map(A2:A;B2:B;lambda(Σ;Λ;if(or(Σ="";Λ="");;index(if(ifna(xmatch(substitute(C1:E1;"Count ";);xlookup(Σ;G:G;H:I;)));Λ;)))))

enter image description here

Sign up to request clarification or add additional context in comments.

2 Comments

Its extremely time taking for any of us here to create formulas if you provide test data via screenshots. You have two options: 1 You can easily share the spreadsheet data tables via this online table generator. Just paste the spreadsheet data in that generator→then copy-paste the data here in the question. super simple. 2 you can also share a test sheet using this anonymous blank sheet maker & is super recommended
Noted sir with pleasure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.