vendredi 29 janvier 2021

Using IF statement with data validation in Excel

I am new to excel and trying to use the IF statement along with Data Validation to make a conditional list based on a previous answer.

For example: If I chose dogs in B3, id like only the breed go dogs to show up (breeds of dogs are listed in column on info sheet in same workbook), but if I choose cats, id like only the breed of cats to show up (breeds of cats are listed in the column next to breed of dogs on info sheet in same workbook)

This is the code I am using: IF(B3=Info!$A$2,Info!$A$3:A$6,IF(B3=Info!$B$2,Info!$B$3:$B$6,IF(B3=Info!$C$2,Info!$C$3:$C$9,IF(B3=Info!$D$2,Info!$D$3:$D$7,IF(B3=Info!$E$2,Info!$E$3:$E$6,IF(B3=Info!$F$2,Info!$F$3:$F$10,IF(B3=Info!$G$2,Info!$G$3:$G$6,IF(B3=Info!$H$2,Info!$H$3:$H$7,IF(B3=Info!$I$2,Info!$I$3:$I$7,IF(B3=Info!$J$2,Info!$J$3:$J$5))))))))))

In this code, B3 is the cell that with the original condition (ie dogs or cats) and Info!sheet is the worksheet that includes the breeds in specific columns. For example, "dogs" breeds would be Info!$A$2 and all the dog breeds listed would be Info!$A$3:A$6.

Thanks for your help!!! I really appreciate it.

Aucun commentaire:

Enregistrer un commentaire