Nested If with 2 Index Matches

ClaireLou

New Member
Joined
Nov 14, 2020
Messages
12
Office Version
  1. 365
Platform
  1. Windows
Hi

I'm trying to pull back a reference number and a date. They could be on one of 2 sheets. I originally used 2 Index Matches but used the &" "& to separate them and it wasn't working with the date, I couldn't get it into the date format. Someone suggested putting it into a nested IF formula. I've put one of the index matches below that I need it to do but I'm not sure how to put that into a nested IF. The date is similar but with different columns.

IFERROR(INDEX(MKZ!D:D,MATCH('Sheet1'!H6,MKZ!N:N,0))
IFERROR(INDEX(SGC!D:D,MATCH('Sheet1'!H6,SGC!N:N,0))

I'd really appreciate any help

Thanks
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
=IFERROR(INDEX(MKZ!D:D,MATCH(Sheet1!H6,MKZ!N:N,0)),IFERROR(INDEX(SGC!D:D,MATCH(Sheet1!H6,SGC!N:N,0)),"NoMatch"))

This will test the first sheet MKZ FIRST and if no match found will then try the SGC sheet , if no match then returns nomatch

If you want to Test SGC sheet first , then change so that formula is the first
 
Upvote 0
Solution
you are welcome

its not really a nested IF in the true sense
IF( TEST, TRUE , FALSE)
is a normal IF you can add another IF in place of the TRUE or FALSE or both - to make a nested IF
IF( TEST1, TRUE , IF( TEST2, TRUE , FALSE))
So if TEST1 is FALSE - then it will do the 2nd IF and so do a test2
 
Upvote 0
Thanks so much for that, I haven't really used nested IF's much before :)
 
Upvote 0

Forum statistics

Threads
1,214,648
Messages
6,120,726
Members
448,987
Latest member
marion_davis

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