Formula nesting help

Dan88

Active Member
Joined
Feb 14, 2008
Messages
275
Office Version
  1. 365
Platform
  1. Windows
Hello Everyone, i have the following formula that compares 2 sheets and returns Yes Or NO.

The formula is auto filled entire column. So if my data spans from AD3 to AD 80, i will have 8 rows of "No". iS there a way to blank this out?


=IF(ISNA(VLOOKUP(A11, 'SP'!$AD$3:$AD$88,1,FALSE)), "No", "Yes")


Thanks
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
You can nest the whole thing inside a blank check function:

=IF(A11="","",IF(ISNA(VLOOKUP(A11, 'SP'!$AD$3:$AD$88,1,FALSE)), "No", "Yes"))
 
Upvote 0
Thanks for the quick reply brown bread!

I added additional "" to NO and Yes but now when i run the vba, it fills the cells with FALSE rather than a YES or NO. Any other thing im doing wrong:

Range("I2").Formula = "=IF(A11="","",IF(ISNA(VLOOKUP(A11, 'SP'!$AD$3:$AD$88,1,FALSE)), ""No"", ""Yes""))"

Thanks
 
Upvote 0
It needs to be:
Code:
[COLOR=#333333]Range("I2").Formula = "=IF(A11=[/COLOR][COLOR=#ff0000]"""",""""[/COLOR][COLOR=#333333],IF(ISNA(VLOOKUP(A11, 'SP'!$AD$3:$AD$88,1,FALSE)), ""No"", ""Yes""))"[/COLOR]
(you need to double-up on the double-quotes, because they are used both as text qualifiers in VBA code and literal values in your formula).

This often gets confusing, but there is an easy way to get the code that you need. Turn on your Macro Recorder and record yourself entering the formula on the sheet, then stop the Macro Recorder and view your code. This will show you how the code needs to be written in VBA.
 
Upvote 0
Joe4, BrownBread you guys are both LEGENDS!

It worked. THanks so much for the pointers! Much Much appreciated.
I knew it had to do with addtional qoutes so i added one to the No and Yes but didnt think to add it to the code BrownBread did for me.

Awesome. Thanks again!
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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