Simplify VLOOKUP and IF Formula?

jeffcoleky

Active Member
Joined
May 24, 2011
Messages
274
I created the formula below that does the following: Display "Yes" if the address is For Sale, and if not, check to see if it's Vacant, and if so display "TRUE". Otherwise leave cell empty. I even have a working formula...

Here's my sample data:

Excel 2010
ABCDE
1DATAVacant(normally in another workbook)For Sale
(normally in another Sheet)
2111 main stTRUEYes
3222 smith rdFALSEYes
4333 sammy rdTRUE
5678 Ninth StFALSENo
6
7LOOKUPSVacant LookupFor Sale LookupCurrent Formula
8111 main stTRUEYesYes
9222 smith rdFALSEYesYes
10333 sammy rdTRUE0TRUE
11555 Notfoundabove Rd#N/A#N/A

<tbody>
</tbody>
Sheet1

B8 Formula:
Code:
=VLOOKUP($A8,A$2:C$5,2,FALSE)
C8 Formula:
Code:
=VLOOKUP($A8,A$2:C$5,3,FALSE)
E8 Formula, (desired result) is working when combined with the other two formulas:
Code:
=IF(ISNA(C8),IF(ISNA(B8),"",IF(C8="Yes",C8,IF(B8="TRUE","TRUE",""))),IF(C8=0,IF(B8=0,"",B8),C8))

My formulas in C8:C11 are working! However, my problem is that my ACTUAL data doesn't look this clean. My actual data doesn't have the Lookup fields in B8:C11. It looks more like A2:C5 + A8:A11. I need help to COMBINE my formula in E8 with the formulas in B8 & C8.

Doing so the only way I know how to, looks like this:
Code:
=IF(ISNA(VLOOKUP($A8,A$2:C$5,3,FALSE)),IF(ISNA(VLOOKUP($A8,A$2:C$5,2,FALSE)),"",IF(VLOOKUP($A8,A$2:C$5,3,FALSE)="Yes",VLOOKUP($A8,A$2:C$5,3,FALSE),IF(VLOOKUP($A8,A$2:C$5,2,FALSE)="TRUE","TRUE",""))),IF(VLOOKUP($A8,A$2:C$5,3,FALSE)=0,IF(VLOOKUP($A8,A$2:C$5,2,FALSE)=0,"",VLOOKUP($A8,A$2:C$5,2,FALSE)),VLOOKUP($A8,A$2:C$5,3,FALSE)))

Is there a shorter way to write this formula?

With my actual data, the values I'm looking up using VLOOKUP, are actually located in other workbooks too! So the above formula, combined with all the paths, filenames, etc. makes this thing look like a monster formula!

I've spent HOURS trying to shorten this formula today, but with no success.. Can anyone help?
 
Try this: =IFERROR(IF(IF(ISNUMBER(MATCH(A8,$A$2:$A$5,0)),VLOOKUP(A8,$A$2:$C$5,3,0))="Yes","Yes",IF(VLOOKUP(A8,$A$14:$B$17,2,0)=TRUE,TRUE,"")),"")
 
Upvote 0

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Try this: =IFERROR(IF(IF(ISNUMBER(MATCH(A8,$A$2:$A$5,0)),VLOOKUP(A8,$A$2:$C$5,3,0))="Yes","Yes",IF(VLOOKUP(A8,$A$14:$B$17,2,0)=TRUE,TRUE,"")),"")

Perfect! Yay! Sorry for the confusion and I appreciate you adapting. Your help & time spent are greatly appreciated!
 
Upvote 0

Forum statistics

Threads
1,216,750
Messages
6,132,506
Members
449,730
Latest member
SeanHT

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