ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Blank Cell (https://www.excelbanter.com/excel-programming/393851-blank-cell.html)

quattda

Blank Cell
 
I am using VLOOKUP to find and enter an associated time value in a cell (D2)
that is referencing another cell (D1). D1 generally blank until a text choice
is made using a drop-down list. I would like to not have the #N/A message in
D2 when D1 is blank. I could put in a generic character (such as ?) and use
the IF function. However, I was wondering if there is a way determine a blank
cell directly using the IF function?

Anony

Blank Cell
 
To determine blank cell, just type two quotation marks:
=If(D1="", True, False)


"quattda" wrote:

I am using VLOOKUP to find and enter an associated time value in a cell (D2)
that is referencing another cell (D1). D1 generally blank until a text choice
is made using a drop-down list. I would like to not have the #N/A message in
D2 when D1 is blank. I could put in a generic character (such as ?) and use
the IF function. However, I was wondering if there is a way determine a blank
cell directly using the IF function?


quattda

Blank Cell
 
Thanks

"Anony" wrote:

To determine blank cell, just type two quotation marks:
=If(D1="", True, False)


"quattda" wrote:

I am using VLOOKUP to find and enter an associated time value in a cell (D2)
that is referencing another cell (D1). D1 generally blank until a text choice
is made using a drop-down list. I would like to not have the #N/A message in
D2 when D1 is blank. I could put in a generic character (such as ?) and use
the IF function. However, I was wondering if there is a way determine a blank
cell directly using the IF function?


IanKR

Blank Cell
 
I am using VLOOKUP to find and enter an associated time value in a
cell (D2) that is referencing another cell (D1). D1 generally blank
until a text choice is made using a drop-down list. I would like to
not have the #N/A message in D2 when D1 is blank. I could put in a
generic character (such as ?) and use the IF function. However, I was
wondering if there is a way determine a blank cell directly using the
IF function?


If it helps, I use a UDF to return zero (or you could change this value to
suit yourself) if VLOOKUP returns #N/A:

Function NewVLookup(Value As Variant, Table As Variant, _
ColIndex As Integer, RangeLookup As Boolean) As Variant
With Application
If .IsNA(.VLookup(Value, Table, _
ColIndex, RangeLookup)) Then
NewVLookup = 0 ' <========== or put your own value here
Else
NewVLookup = .VLookup(Value, Table, ColIndex, RangeLookup)
End If
End With
End Function




All times are GMT +1. The time now is 06:33 PM.

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