ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Vlookup and IF? (https://www.excelbanter.com/excel-worksheet-functions/130178-vlookup-if.html)

Vance

Vlookup and IF?
 

I am using vlookup to calculate a value which is wroking great. However, if
another cell has a zero value, I want my vlookup cell to be zero as well.

cell D22...=VLOOKUP(D18,B33:C49,2)

I want to add to the above formula... if another cell (D21) calculation
result is zero, make this cell (D22) zero as well.

What would the new formula be?

Thank you!
Vance



--
Vance

Sandy Mann

Vlookup and IF?
 
=IF(D21=0,0,VLOOKUP(D18,B33:C49,2))

This however will return zero even in D21 is empty. To avoid that then use:

=IF(D21="","",IFD21=0,0,VLOOKUP(D18,B33:C49,2)))

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"Vance" wrote in message
...

I am using vlookup to calculate a value which is wroking great. However,
if
another cell has a zero value, I want my vlookup cell to be zero as well.

cell D22...=VLOOKUP(D18,B33:C49,2)

I want to add to the above formula... if another cell (D21) calculation
result is zero, make this cell (D22) zero as well.

What would the new formula be?

Thank you!
Vance



--
Vance




Vance

Vlookup and IF?
 
Thank you Sandy - that worked perfect!
--
Vance


"Sandy Mann" wrote:

=IF(D21=0,0,VLOOKUP(D18,B33:C49,2))

This however will return zero even in D21 is empty. To avoid that then use:

=IF(D21="","",IFD21=0,0,VLOOKUP(D18,B33:C49,2)))

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"Vance" wrote in message
...

I am using vlookup to calculate a value which is wroking great. However,
if
another cell has a zero value, I want my vlookup cell to be zero as well.

cell D22...=VLOOKUP(D18,B33:C49,2)

I want to add to the above formula... if another cell (D21) calculation
result is zero, make this cell (D22) zero as well.

What would the new formula be?

Thank you!
Vance



--
Vance





Sandy Mann

Vlookup and IF?
 
You're very welcome - hope that you did not try to use the 2nd formula
because I see that I left out an opening parenthesis. It should have been

=IF(D21="","",IF(D21=0,0,VLOOKUP(D18,B33:C49,2)))

So much for editing in the post without testing!

--
Regards,

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"Vance" wrote in message
...
Thank you Sandy - that worked perfect!
--
Vance


"Sandy Mann" wrote:

=IF(D21=0,0,VLOOKUP(D18,B33:C49,2))

This however will return zero even in D21 is empty. To avoid that then
use:

=IF(D21="","",IFD21=0,0,VLOOKUP(D18,B33:C49,2)))

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"Vance" wrote in message
...

I am using vlookup to calculate a value which is wroking great.
However,
if
another cell has a zero value, I want my vlookup cell to be zero as
well.

cell D22...=VLOOKUP(D18,B33:C49,2)

I want to add to the above formula... if another cell (D21) calculation
result is zero, make this cell (D22) zero as well.

What would the new formula be?

Thank you!
Vance



--
Vance








All times are GMT +1. The time now is 07:15 AM.

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