Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

UNIQUE function with IF-Condition containing multiple AND-Conditions

  |    A   |    B   |    C   |    D   |    E   |    F    |     
--|--------|--------|--------|--------|--------|---------|-------
1 |    1   |        |  2021  |  2022  |  2021  |   2022  |
2 |    1   |        |  test  |    1   |  test  |         |
3 |    1   |        |    2   |    2   |    2   |         |
4 |    2   |        |    3   |    3   |    3   |         |
5 |    3   |        |        |        |        |         |
6 |    3   |        |        |        |        |         |
7 |    1   |        |        |        |        |         |

In Columns C:E I want to insert a unique list of the values in Column A.

Additionally, if

  1. the value in Row 1 is smaller than the value in Cell $F$1 AND
  2. one of the UNIQUE values equals the number 1

then the word "test" should be displayed instead of the number 1.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel


I tried to go with this formula:

C2:E2 = =IF(AND(C$1<$F$1,UNIQUE($A$1:$A$7)=1),"test",UNIQUE($A$1:$A$7))

However, somehow this formula ignores the conditions and keeps displaying a 1 instead of the word test.

What do I need to change to make it work?

>Solution :

You need to use the multiplication sign (*) instead of AND in array formulas:

=IF((C$1<$F$1)*(UNIQUE($A$1:$A$7)=1),"test",UNIQUE($A$1:$A$7))

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading