How to ignore blank cells with VLOOKUP formula
I have been searching for hours with no luck on fixing this issue. I have a grid that I am using to populate raw data. I would like to combine this data into a more clean grid that I will be able to pull reports from. However, there are blank cells in the raw data grid so it is not pulling the information from where there is data filled in. How can I tell Smartsheet to ignore the blank cells?
This is the formula that I am using:
=VLOOKUP([Quote Number]@row, {Work Breakdown Structure Raw Data - All Cells}, 4, false))
If there is data in the first instance of the column, the formula works fine (see highlighted cell below)
But if there are any blanks before the cell with a value, it comes back #UNPARSEABLE.
Any help is greatly appreciated.
Best Answer
-
Try an INDEX/COLLECT. You will need a slight tweak for each of the different department columns.
=IFERROR(INDEX(COLLECT({Form Sheet Engineering Data Entry Column}, {Form Sheet Quote Number Column}, @cell = [Quote #]@row, {Form Sheet Department Column}, @cell = "Engineering"), 1), "")
Then for the PMO department, you would change the first range to pull from the PMO dept.'s data entry column and the final criteria to "PMO" instead of "Engineering". So on and so forth until you have taken care of each department.
Answers
-
Hello @Mallory N
First, move away from the VLOOKUP function. :)
Second, you can use the INDEX/COLLECT function to set multiple criteria. If you want to specify an array as the range and manually enter the column number to reference, then you still can, but I recommend only selecting a single column as a range being evaluated.
For example:
=INDEX(COLLECT({Work Breakdown Structure Raw Data - All Cells},{COLUMN WITH THE QUOTE NUMBER},[Quote Number]@row,{COLUMN WITH THE BLANK VALUES},[Column with blank values]@row<>""),1)
The 1 at the end is the column number.
-
To clarify, do you mean if there's a blank column to the left of the search value column it returns #UNPARSABLE?
Have you tried using an INDEX(MATCH) formula instead?
If you want to stick with the VLOOKUP function, maybe wrap VLOOKUP in an IF(ISBLANK() like so:
=IF(ISBLANK([Quote Number]@row), "", VLOOKUP([Quote Number]@row, {Work Breakdown Structure Raw Data - All Cells}, 4, false))
It also looks like you might have an extra parenthesis at the end of the VLOOKUP formula you provided
If my response was helpful in any way (or answered your question) please be sure to upvote it, mark it as awesome, or mark it as the accepted answer!
I'm always looking to connect with other industry professionals, feel free to connect with me on LinkedIn as well!
-
I am using a form to populate only some cells associated with each quote (the primary column). My desire is for the 5 rows that will be associated with the same quote number from the different submission of the form to be copied over to another easy to read grid.
So in this example that I have shown, quote number is "test" - in the other grid, i would like for the values entered by both Engineering and PMO to populate on the same line. Because the Engineering line is first, it only populates the blank cell shown for that instance. If I add a value into the highlighted cell, it will show up onto the other sheet, but that obviously takes away from the point of this process being automated.
I have not been successful in trying to use INDEX/COLLECT or the ISBLANK functions. I am using SmartsheetGov if that matters.
-
The form and your subscription should not make a difference, in your situation.
You brought automations into the mix.
Could you provide me the whole situation?
What automations are you using? Copy row? Move Row?
What's the trigger? Are there any conditions?
Are you trying to use a lookup function as a trigger?
-
I have two sheets - one with raw data that is populated from a form and another that I would like to pull information from the raw data to combine all raw data for each quote into one line. There are no automations involved in this portion of the workbook.
The form is set up that depending on the department, fields will populate to only fill certain columns that are associated with that department. I am trying to use VLOOKUP to transcribe data from the raw data sheet to the combined data sheet to put all of the various data from each department into the same line, but this has not been working because it is pulling the blank cells from the raw data sheet. I am looking for something to include in the function to make the system ignore the blank cells.
This is the raw data sheet:
This is the combined data sheet:
-
Try an INDEX/COLLECT. You will need a slight tweak for each of the different department columns.
=IFERROR(INDEX(COLLECT({Form Sheet Engineering Data Entry Column}, {Form Sheet Quote Number Column}, @cell = [Quote #]@row, {Form Sheet Department Column}, @cell = "Engineering"), 1), "")
Then for the PMO department, you would change the first range to pull from the PMO dept.'s data entry column and the final criteria to "PMO" instead of "Engineering". So on and so forth until you have taken care of each department.
-
Thank you Paul, that worked beautifully for the initial row. However, it is not allowing me to convert to a column formula. Is there something special I should be doing to make this work?
-
The formula I provided should work as a column formula. Are you able to provide a screenshot of the formula open in the sheet as if you are about to edit it?
-
That's very odd. Are you using this column in any dependency settings or anything?
-
No, I am not. It allowed me to convert to a column formula on the second column after the primary column (where the name is seen), but not any of the other columns. They all show greyed out like shown above.
-
Are any of them part of any automations?
-
No, there aren't any automations on the sheet yet.
-
What happens if you just click on the cell containing the formula one time? Don't actually open it as if you are editing it. Just select the cell itself?
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.5K Get Help
- 424 Global Discussions
- 136 Industry Talk
- 465 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 146 Just for fun
- 63 Community Job Board
- 465 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 301 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!