Question about IF, ISBLANK and VLOOKUP

JamieP89

Board Regular
Joined
Mar 8, 2022
Messages
64
Office Version
  1. 365
Platform
  1. Windows
Hi all,

So I’m starting to get better with excel and becoming more comfortable coming up with solutions myself which is great.

I have however stumbled into a problem.

I’m trying to nest a ISBLANK into an IF statement while using 3 VLOOKUPS to look accords three separate columns for potential data input (only 1 column would ever contain data)

I want to be able to show a blank cell unless one of the 3 columns is filled in but every time I try this, I get “too few many arguments” comments thrown at me.

I can get the logic to work with one VLOOKUP but just can’t seem to make it work with more than one…

Hopefully someone can explain how to make this worth with an example of how it should read !
 
Sorry perhaps I'm not being clear enough.

Book10
ABC
1Project Name
2Project 13
3
4
Sheet2
Cell Formulas
RangeFormula
B2B2=IFERROR(IFS(VLOOKUP(Sheet2!A2,Sheet1!A:D,4,FALSE),VLOOKUP(Sheet2!A2,Sheet1!A:D,4,FALSE),VLOOKUP(Sheet2!A2,Sheet1!A:D,3,FALSE),VLOOKUP(Sheet2!A2,Sheet1!A:D,3,FALSE),VLOOKUP(Sheet2!A2,Sheet1!A:D,2,FALSE),VLOOKUP(Sheet2!A2,Sheet1!A:D,2,FALSE)),"")


Book10
ABCD
1NameFirst numberSecond NumberThird Number
2Project 1123
3
Sheet1


This is what I am doing in reality. I am looking (for examples purchase on another sheet (would usually be a workbook) and asking it to check the columns 4,3,2 (it is then superseeding the previous input number i.e. if I were to put a 1 in column 2, it would give two, but if I then kept two in there, and put a 1 in column 3 it would give me 1 until the final column gets data entry and am left with the final number.

As I say, not so much needed in the initial issue i was having but keen to explore if there is a better way to achieve this long winded formula (no doubt slowing my excel down)

Sorry I can't presume to understand your formula above.

but if it makes it do what I have done there, keen to learn!
 
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.
This is what I am doing in reality.
I was using your original information. ;)
(only 1 column would ever contain data)

JamieP89.xlsm
ABCD
1NameFirst numberSecond NumberThird Number
2Project 1513
3Project 26
4Project 3
5Project 4322
Sheet1


JamieP89.xlsm
AB
1Project NameLast Num
2Project 13
3Project 3 
4Project 422
5Project 26
6Project 8 
Sheet2
Cell Formulas
RangeFormula
B2:B6B2=IFNA(LOOKUP(9E+307,FILTER(Sheet1!B$2:D$5,Sheet1!A$2:A$5=A2,NA())),"")
 
Upvote 0
Solution
I was using your original information. ;)


JamieP89.xlsm
ABCD
1NameFirst numberSecond NumberThird Number
2Project 1513
3Project 26
4Project 3
5Project 4322
Sheet1


JamieP89.xlsm
AB
1Project NameLast Num
2Project 13
3Project 3 
4Project 422
5Project 26
6Project 8 
Sheet2
Cell Formulas
RangeFormula
B2:B6B2=IFNA(LOOKUP(9E+307,FILTER(Sheet1!B$2:D$5,Sheet1!A$2:A$5=A2,NA())),"")
Thanks for this, would you be able to breakdown how this formula is working as never seen this sort of formula.
 
Upvote 0
would you be able to breakdown how this formula is working
Using my sample data and the formula for Project 4

On Sheet1 it FILTERs B2:D5 and returns everything where column A = Project 4. That returns a single row with these three values
1655175511460.png

LOOKUP then looks for 9E307, a very big number (9 followed by 307 zeros). A feature of LOOKUP is that if the number being looked for cannot be found and there is nothing bigger than the number being looked for, the function returns the last number that is does find. In this case the last number found in that row is 22.

If the project name cannot be found in Sheet1 or the project name can be found but LOOKUP cannot find any numbers at all in the row then the lookup returns #NA. The IFNA function converts such results to a null string as in rows 3 and 6 of my sample.

Much simpler than all those VLOOKUPS, particularly if you had lots of columns to look in instead of just 3.
 
Upvote 0
Using my sample data and the formula for Project 4

On Sheet1 it FILTERs B2:D5 and returns everything where column A = Project 4. That returns a single row with these three values
View attachment 67009
LOOKUP then looks for 9E307, a very big number (9 followed by 307 zeros). A feature of LOOKUP is that if the number being looked for cannot be found and there is nothing bigger than the number being looked for, the function returns the last number that is does find. In this case the last number found in that row is 22.

If the project name cannot be found in Sheet1 or the project name can be found but LOOKUP cannot find any numbers at all in the row then the lookup returns #NA. The IFNA function converts such results to a null string as in rows 3 and 6 of my sample.

Much simpler than all those VLOOKUPS, particularly if you had lots of columns to look in instead of just 3.
I see! And how is it identifying project 4 over day project 3?

I’m so used to having to call out a name to look for to match like In VLOOKUP so keen to understand the logic of how it’s matching the project names
 
Upvote 0
And how is it identifying project 4 over day project 3?
The formula in B4 of Sheet2 is
=IFNA(LOOKUP(9E+307,FILTER(Sheet1!B$2:D$5,Sheet1!A$2:A$5=A4,NA())),"")
A4 in Sheet2 is "Project 4" so the identification of the correct row from Sheet1 is made by the red part of the formula.
 
Upvote 0
The formula in B4 of Sheet2 is
=IFNA(LOOKUP(9E+307,FILTER(Sheet1!B$2:D$5,Sheet1!A$2:A$5=A4,NA())),"")
A4 in Sheet2 is "Project 4" so the identification of the correct row from Sheet1 is made by the red part of the formula.
Thanks so much for the help around this. Now I need to look to better understand FILTER (Can FILTER, filter out multiple points to provide a result??)

I was creating a formula today using COUNTIF and needed to only count certain record names and ended up settling on a SUM(COUNTIF to avoid SPILL.
 
Upvote 0
Can FILTER, filter out multiple points to provide a result??
Most likely 'yes' but would need to know details of just what you have and what you are trying to achieve to advise further.
 
Upvote 0
Most likely 'yes' but would need to know details of just what you have and what you are trying to achieve to advise further.
Okay well I will post a new topic as technically you’ve answered my question and I’ve marked as answered
 
Upvote 0

Forum statistics

Threads
1,214,942
Messages
6,122,366
Members
449,080
Latest member
Armadillos

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