Lookup with numeric value multiple criteria within the logical operator used

How do I implement a function formula to search a matching value based on the 3 conditions below inside LibreOffice calc application under the below array table sheet showed?
The condition is:

  1. cymk, color code category.
  2. & 3. density range between lower and upper .

The result is column 1 on the color field, where the color it belongs, for example, the result is ‘Lilac’,
whereby the condition colour code category is ‘M’ while the density ‘0.25’.

colour CYMK density range
Orange C 0.10 0.20
Orange Y 0.20 0.45
Red Y 0.65 0.80
Red M 0.65 0.85
Lilac M 0.20 0.30
Lilac K 0.20 0.30
Grey M 0.10 0.19
Grey K 0.10 0.19
Dark Blue C 0.50 0.95
Dark Blue K 0.45 0.85
BLUE 544 C 0.25 0.40
BLUE 544 K 0.25 0.40
BLUE 291 C 0.25 0.35
BLUE 291 Y 0.10 0.20

It seems to me that a formula like
=TEXTJOIN(";";1;IF(($B$2:$B$15=<color code category>)+($C$2:$C$15<=<density>)+($D$2:$D$15>=<density>)>2;$A$2:$A$15;""))
can give a good result.

If in F1 and in G1 then formula will be
{=TEXTJOIN(";";1;IF(($B$2:$B$15=$F$1)+($C$2:$C$15<=$G$1)+($D$2:$D$15>=$G$1)>2;$A$2:$A$15;""))}
For M 0.25 this will return Lilac
For C 0.25 this will return BLUE 544;BLUE 291

This is an array formula, the input is completed by pressing Ctrl+Shift+Enter

1 Like

thank you it works