Function problem

andonny

Board Regular
Joined
Mar 11, 2002
Messages
220
Hi,
The function below does not return what I need and I can't work it out.

,=IF(ISNA(-VLOOKUP(E21,Stocktake!$A$1:$I$65000,9,FALSE)),-T213,-VLOOKUP(E21,Stocktake!$A$1:$I$65000,9,FALSE)-T21)

When E21 is blank or it can't fine any data in Stocktake!$A$1:$I$65000 it needs to return the a negative value of T213. If I have 5 in T213 then it should return -5.

Your help is very much appreciated
Andonny
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
On 2002-05-11 01:03, andonny wrote:
Hi,
The function below does not return what I need and I can't work it out.

,=IF(ISNA(-VLOOKUP(E21,Stocktake!$A$1:$I$65000,9,FALSE)),-T213,-VLOOKUP(E21,Stocktake!$A$1:$I$65000,9,FALSE)-T21)

When E21 is blank or it can't fine any data in Stocktake!$A$1:$I$65000 it needs to return the a negative value of T213. If I have 5 in T213 then it should return -5.

Your help is very much appreciated
Andonny


=IF(COUNTIF(Stocktake!$A$1:$A$65000,E21),-VLOOKUP(E21,Stocktake!$A$1:$I$65000,9,0)-T21,-T213)

Caveat. If you want to have a negative result even if T213 already has a negative value, then you could also use:

=-IF(COUNTIF(Stocktake!$A$1:$A$65000,E21),VLOOKUP(E21,Stocktake!$A$1:$I$65000,9,0)-T21,ABS(T213))

Note. I used 0 instead of FALSE (they mean same thing) in VLOOKUP.

Aladin
 
Upvote 0
Code:
=IF(ISNA(-VLOOKUP(E21,StockTake!$A:$I000,9,FALSE)),-INDEX(T:T,213,T:T),-VLOOKUP(E21,StockTake!$A:$I000,9,FALSE)-INDEX(T:T,21,T:T))
This message was edited by Nimrod on 2002-05-11 01:42
 
Upvote 0

Forum statistics

Threads
1,214,431
Messages
6,119,458
Members
448,899
Latest member
maplemeadows

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