Nested IF / VLOOKUP loops searching multiple worksheets

jouno

New Member
Joined
Jul 2, 2018
Messages
3
Job#NameTypeStage
1010Elm RanchResidentialDesign
1012Oak Park Dev.Non-ResidentialDesign
1015.5Beechwood EstatesMixed UsePlanning

<tbody>
</tbody>

I have worksheets spanning the last 6 years detailing jobs. The earlier (2013-2015) worksheets don't have type and stage, which I need. I've added columns and tried to fill them in using the more recent data with:
//searching for type
=VLOOKUP(A9,'[Worksheet2016]Projects'!$A$7:$D$135, 3, FALSE)

which works for a single worksheet, but I would like to make nested IFs to search all 3 recent worksheets. The logic is like:
IF (worksheet2016 returns a value, good, if not)
ELSEIF (worksheet2017)
ELSEIF (worksheet2018)
Else "not found"

I'd like to do this with Excel code if possible, not VBA. Not sure of the Excel syntax.
Based on earlier searches through this forum, I tried:

//full pathname elided
=IF(VLOOKUP(A8,'worksheet2016'!$A$7:$D$135,3,FALSE)=A8,A8,IF(VLOOKUP(A8,'worksheet2017'!$A$7:$D$135,3,FALSE)=A8,A8,IF(VLOOKUP(A8,'worksheet2018'!$A$2:$D$157,3,FALSE)=A8,A8,"not found")))
but that only returns #N/A
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
try this out

=IF(NOT(ISNA(VLOOKUP(A8,worksheet2016!$A$7:$D$135,3,FALSE))),A8,IF(NOT(ISNA(VLOOKUP(A8,worksheet2017!$A$7:$D$135,3,FALSE))),A8,IF(NOT(ISNA(VLOOKUP(A8,worksheet2018!$A$2:$D$157,3,FALSE))),A8,"not found")))

the reason why yours was not working is because you are not searching in a single column... if you were yours would have been fine but since you are returning a value from column D ... D8 will never equal A8 ... sorta lol
 
Last edited:
Upvote 0
Thanks! Not quite what I was looking for, as it pops the job number into the type column, but better than all those #N/As.
I'm trying to collect data from columns 3 and 4 (not necessarily both at once) to put into worksheets that lack that data. Jobs get added, deleted, and changed in status from year to year. Maybe 50% of the blanks can be filled in with this formula.
How is your formula retrieving/displaying the job number and not the type?
 
Upvote 0

Forum statistics

Threads
1,214,987
Messages
6,122,613
Members
449,090
Latest member
vivek chauhan

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