formula error. how do I add a new if/vlookup criteria?

teikma

New Member
Joined
Jun 27, 2015
Messages
7
Here's a link to some screen captures of what I have.... Imgur


This is the formula I'm using now and it works fine with no errors.....
=IF(D12=704,VLOOKUP(B12,Table1[#All],7),VLOOKUP(D12,'Pivot by Account'!$A$4:$D$10,4))



But I need to add an additional criteria.... if cell D12 is 704 and B12 on the original Table1 lookup is blank, I need look up a value in cell A12 and the output needs to be from a column in the table

=IF(D12=704,VLOOKUP(B12,Table1[#All],7),if(B12"",vlookup(a12,Table1[#All],7)),VLOOKUP(D12,'Pivot by Account'!$A$4:$D$10,4))

I am getting an error on this part ...B5""
forgive me if I didn't post my question correctly, this is my first post.
 

Some videos you may like

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

oldbrewer

Board Regular
Joined
Apr 11, 2010
Messages
11,005
=if(d12=704,if(b12="",vlookup(a12,table1[#all],7),vlookup(b12,table1[#all],7),vlookup(d12,'pivot by account'!$a$4:$d$10,4)))
 

teikma

New Member
Joined
Jun 27, 2015
Messages
7
thank you oldbrewer, I copy/pasted that formula and I received the following error message:
You've entered too many arguments for this function.
 

oldbrewer

Board Regular
Joined
Apr 11, 2010
Messages
11,005
=if(d12=704,if(b12="",vlookup(a12,table1[#all],7),vlookup(b12,table1[#all],7)),vlookup(d12,'pivot by account'!$a$4:$d$10,4))

my error - i think it needs 2 close brackets after the 7 and then one less at the end

it means if x, if y, something or something else, something different

something different comes in where if x is not true, something comes in where x and y are true and something else comes in when x is true and y is not true
 

Watch MrExcel Video

Forum statistics

Threads
1,123,143
Messages
5,599,975
Members
414,354
Latest member
Flaxarn

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
Top