• 409K Members
• 6,640 Online
• 466K Conversations

Contributor

# Two formulas that work dont work when combined with IFs or IF

Formula A is

=IFS(MATCH(\$AA15,\$AJ\$5:\$AJ\$14,0),INDEX(RA[FLOP],MATCH(1,(RA[TYPE]=\$AA15)*(ABS((AVERAGEIF(RA[TYPE],\$AA15,RA[EQUITY])-RA[EQUITY]))=AGGREGATE(15,6,1/(RA[TYPE]=\$AA15)*(ABS(AVERAGEIF(RA[TYPE],\$AA15,RA[EQUITY])-RA[EQUITY])),1)),0)))

Formula B is

When I combine then whichever comes second is returning #NA but whcever is first works fine

Ex1

Ex2 reversed order

I did also try using IF and then whichever one was in the if false criteria would return an error

# Re: Two formulas that work dont work when combined with IFs or IF

@Dichotomy66 , if I understood correctly your formula looks like

`=IFS(MATCH(<1>),<value 1>, MATCH(<2>), <value 2>)`

IMHO, entire logic is incorrect. If you have no first match, MATCH(<1>) returns #N/A and entire formula also returns #N/A. If first matches, you calculate and return value 1. You may go on second match if only first one returns zero, but it can't return zero position.

If you want to check if MATCH finds something or not, use it in form

`=IFS(ISNUMBER(MATCH(<1>)),<value 1>, ISNUMBER(MATCH(<2>)), <value 2>)`
Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
22 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
cntvertex in Discussions on
13 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies