IF AND not working as expected. See expected results

Mllam

New Member
Joined
Feb 16, 2022
Messages
9
Office Version
  1. 365
Platform
  1. Windows
Test.xlsx
ABCDEFGH
1SkuCompetitor SkuCross 1Disti 1Cross 2Disti 2IF ANDExpected Results
211111x11xZ11xXZ and XZ and X
322222x22xZ#N/A#N/A#N/AZ
433333x33xZ33xXZ and XZ and X
544444x#N/A#N/A#N/A#N/A#N/ANo
655555x55xZ55xXZ and XZ and X
7
8Disti 1 SkuDisti 2 Sku
911x11x
1022x33x
1133x55x
1255x
Sheet1
Cell Formulas
RangeFormula
C2:C6C2=VLOOKUP(B2,$A$9:$A$12,1,FALSE)
D2:D6D2=IF(C2<>"#N/A","Z","#N/A")
E2:E6E2=VLOOKUP(B2,$C$9:$C$11,1,FALSE)
F2:F6F2=IF(E2<>"#N/A","X","#N/A")
G2:G6G2=IF(AND(D2<>"#N/A",F2<>"#N/A"),"Z and X",IF(AND(D2="#N/A",F2="#N/A"),"No",IF(AND(D2<>"#N/A",F2="#N/A"),D2,IF(AND(D2="#N/A",F2<>"#N/A"),F2,"No"))))
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Hi

A simplified version.

Mappe7
ABCDE
1SkuCompetitor SkuDisti 1Disti 2Result
211111xZXZ and X
322222xZ Z
433333xZXZ and X
544444x   
655555xZXZ and X
7
8Disti 1 SkuDisti 2 Sku
911x11x
1022x33x
1133x55x
1255x
Tabelle1 (2)
Cell Formulas
RangeFormula
C2:C6C2=IF(COUNTIFS($A$9:$A$12,B2),"Z","")
D2:D6D2=IF(COUNTIFS($C$9:$C$11,B2),"X","")
E2:E6E2=TEXTJOIN(" and ",TRUE,C2:D2)
 
Upvote 0
Solution

Forum statistics

Threads
1,223,885
Messages
6,175,181
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top