Forum Discussion
David
Oct 27, 2017Copper Contributor
Can you use AND / OR in an INDEX MATCH
Hi I have am array formula that looks like this: =INDEX('Rebate report'!A:A,MATCH(1,('Rebate report'!A:A=A2)*('Rebate report'!B:B=B2)*('Rebate report'!C:C=C2),0),1) which works. I want to add...
ricardo2260
Jan 15, 2024Copper Contributor
=INDEX('NM & CRM'!$B$4:$D;MATCH(B20;'NM & CRM'!$D$4:$D;0);2)&INDEX('NM & CRM'!$G$4:$I;MATCH(B20;'NM & CRM'!$I$4:$I;0);2)
Sir, can you help me improve this formula, because when I run the formula, 2 names appear. I only want 1 name.
Sir, can you help me improve this formula, because when I run the formula, 2 names appear. I only want 1 name.
ricardo2260
Jan 16, 2024Copper Contributor
ricardo2260 I want to retrieve data in these 2 tables with options, search in table A, if there is, retrieve column data, if there is none, search in table B, if found in column B, retrieve the column.
- ricardo2260Jan 17, 2024Copper ContributorI can do it, thanks for the help mtarler
- mtarlerJan 17, 2024Silver Contributorso I see you are actually using google sheets and not excel so i don't even have to ask what version, which is good because you should use some newer functions. if I'm reading your formula right try:
=LET(first, XLOOKUP(B20, 'NM & CRM'!$D$4:$D, 'NM & CRM'!$C$4:$C,""), IF(first<>"",first, XLOOKUP(B20, 'NM & CRM'!$I$4:$I, 'NM & CRM'!$H$4:$H,""))
basically do the first lookup and assign it to 'first' then check if a value was found and if not do the second lookup.