IF with a ASNA and a VLOOKUP combination formula

pook_666

Board Regular
Joined
Aug 16, 2018
Messages
94
Hi magicians!

I have two formulas that I want to make into one, if at all possible:

Formula one:
Excel Formula:
=IF(ISNA(VLOOKUP(A2&B2,'Sheet1'!A:E,5,FALSE)),F2,VLOOKUP(A2&B2,'Sheet1'!A:E,5,FALSE))

Formula two:
Excel Formula:
=IF('Sheet1'!E2="Yes",H3*2,H3)

What I am trying to do is:
1 - vlookup A2&B2 against Sheet1 A:E
2 - if it exists, then within that vlookup table, if the value in column E is "Yes" then multiply H3*2 and if the answer is "No" simply produce H3 value.
3 - if doesn't exist, produce F2 value

So I kind of need to replace the "5" within the vlookup with formula 2? Bit weird I know, but is there anyway I can combine these into just one cell? Thanks!
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Hi, how about.

=IFNA(IF(VLOOKUP(A2&B2,Sheet1!A:E,5,FALSE)="Yes",H3*2,H3),F2)
 
Upvote 0
Solution
Sorry - I tried just putting this into my VBA code and it doesn't like "Yes" in the formula as I get the "expected end of statement" error....if I change to 'Yes' in VBA then it doesn't work in my cell. Do you know how to change the "Yes"?

VBA code is below if needed:

VBA Code:
Range("I2").Formula = "=IFNA(IF(VLOOKUP(A2&B2,'Sheet1'!A:E,5,FALSE)='Yes',(H2/2*F2),(H2*F2)),(H2*F2))"
 
Upvote 0
You have to double-up the quote marks so change "Yes" to ""Yes""
 
Upvote 0

Forum statistics

Threads
1,214,848
Messages
6,121,914
Members
449,054
Latest member
luca142

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