ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   VLOOKUP worksheet function returns zero for empty cells (https://www.excelbanter.com/excel-worksheet-functions/226179-vlookup-worksheet-function-returns-zero-empty-cells.html)

Hershmab

VLOOKUP worksheet function returns zero for empty cells
 
I am using VLOOKUP to get address information from one "master" worksheet to
another. Some of the master cells are empty (not blank); the value returned
by VLOOKUP in such cases is zero, not blank.

How can I prevent that without calling the function twice in each formula?

Luke M

VLOOKUP worksheet function returns zero for empty cells
 
If you don't want to change the VLOOKUP, change the master data.

Select cells in question.
Bring up Find & Replace (Ctrl+H)

Leave first line blank
In second line, input:
=""

Under options, select match entire cell contents. Then replace all. Your
formula should now return a blank when it finds a "blank" cell.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Hershmab" wrote:

I am using VLOOKUP to get address information from one "master" worksheet to
another. Some of the master cells are empty (not blank); the value returned
by VLOOKUP in such cases is zero, not blank.

How can I prevent that without calling the function twice in each formula?


T. Valko

VLOOKUP worksheet function returns zero for empty cells
 
If the data being returned is text you could use a custom format that
suppresses the display of 0 values. The cell will still contain a numeric 0
it just won't be displayed making the cell appear blank. Otherwise, you
either have to repeat the formula or fill the empty cells with blanks.

To suppress the display of 0:

FormatCellsNumber tabCustom
General;-General;

Or, repeat the formula:

=IF(VLOOKUP(...)="","",VLOOKUP(...))

--
Biff
Microsoft Excel MVP


"Hershmab" wrote in message
...
I am using VLOOKUP to get address information from one "master" worksheet
to
another. Some of the master cells are empty (not blank); the value
returned
by VLOOKUP in such cases is zero, not blank.

How can I prevent that without calling the function twice in each formula?




Hershmab

VLOOKUP worksheet function returns zero for empty cells
 
Unfortunately the first idea will not apply in my circumstances. I am using
this result in a Word Mailmerge where the 0 will be displayed regardless of
its Excel format.

"T. Valko" wrote:

If the data being returned is text you could use a custom format that
suppresses the display of 0 values. The cell will still contain a numeric 0
it just won't be displayed making the cell appear blank. Otherwise, you
either have to repeat the formula or fill the empty cells with blanks.

To suppress the display of 0:

FormatCellsNumber tabCustom
General;-General;

Or, repeat the formula:

=IF(VLOOKUP(...)="","",VLOOKUP(...))

--
Biff
Microsoft Excel MVP


"Hershmab" wrote in message
...
I am using VLOOKUP to get address information from one "master" worksheet
to
another. Some of the master cells are empty (not blank); the value
returned
by VLOOKUP in such cases is zero, not blank.

How can I prevent that without calling the function twice in each formula?





Aidan Gould

This problem was getting the best of me and I couldn't find any other suggestions that worked. Thanks!

Quote:

Originally Posted by Luke M (Post 816643)
If you don't want to change the VLOOKUP, change the master data.

Select cells in question.
Bring up Find & Replace (Ctrl+H)

Leave first line blank
In second line, input:
=""

Under options, select match entire cell contents. Then replace all. Your
formula should now return a blank when it finds a "blank" cell.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Hershmab" wrote:

I am using VLOOKUP to get address information from one "master" worksheet to
another. Some of the master cells are empty (not blank); the value returned
by VLOOKUP in such cases is zero, not blank.

How can I prevent that without calling the function twice in each formula?



All times are GMT +1. The time now is 05:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com