ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   IF Statement Problem (https://www.excelbanter.com/excel-programming/324448-if-statement-problem.html)

No Name

IF Statement Problem
 
I have two columns I want to concentrate on. Column A is
the result of a folmula in the shape of a vlookup.

If the value in A is #N/A I want to take this into
consideration. This is the first thing I dont know how
to do. I also need to take into consideration another
column to get the result I need.

Something like this

=IF(B1="#N/A" AND D2 contains "stw" OR "iwo" THEN "1","0")

I know that is wrong but I know it is possible,

Can someone tell me how to do this. It will be a great
help. Where I have put my "stw" OR "iwo", this 3 letter
seq

JE McGimpsey

IF Statement Problem
 
One way:

=IF(AND(ISNA(B1),OR(D2="stw",D2="iwo")),1,0)

or, more compactly (since XL converts TRUE to 1 and FALSE to 0 in math
operations:

=ISNA(B1)*((D2="stw")+(D2="iwo"))

This assumes that you want 1 or 0, not the strings "1" or "0".


In article ,
wrote:

I have two columns I want to concentrate on. Column A is
the result of a folmula in the shape of a vlookup.

If the value in A is #N/A I want to take this into
consideration. This is the first thing I dont know how
to do. I also need to take into consideration another
column to get the result I need.

Something like this

=IF(B1="#N/A" AND D2 contains "stw" OR "iwo" THEN "1","0")

I know that is wrong but I know it is possible,

Can someone tell me how to do this. It will be a great
help. Where I have put my "stw" OR "iwo", this 3 letter
seq


Jim Thomlinson[_3_]

IF Statement Problem
 
there is a function ISNA

so =if(isna(vlookup(,,,)), "Not Found", vlookup(,,,))

HTH

" wrote:

I have two columns I want to concentrate on. Column A is
the result of a folmula in the shape of a vlookup.

If the value in A is #N/A I want to take this into
consideration. This is the first thing I dont know how
to do. I also need to take into consideration another
column to get the result I need.

Something like this

=IF(B1="#N/A" AND D2 contains "stw" OR "iwo" THEN "1","0")

I know that is wrong but I know it is possible,

Can someone tell me how to do this. It will be a great
help. Where I have put my "stw" OR "iwo", this 3 letter
seq


Jim Thomlinson[_3_]

IF Statement Problem
 
Once you get the isna down pat then you can add the ands and ors

=if(and(isna(vlookup(,,,)), or(find("stw", D2)0, find("iwo", D2)0)), 1, 0)

Without knowing a few more specifics in terms of cell references this is as
far as I can help you...

HTH

" wrote:

I have two columns I want to concentrate on. Column A is
the result of a folmula in the shape of a vlookup.

If the value in A is #N/A I want to take this into
consideration. This is the first thing I dont know how
to do. I also need to take into consideration another
column to get the result I need.

Something like this

=IF(B1="#N/A" AND D2 contains "stw" OR "iwo" THEN "1","0")

I know that is wrong but I know it is possible,

Can someone tell me how to do this. It will be a great
help. Where I have put my "stw" OR "iwo", this 3 letter
seq



All times are GMT +1. The time now is 01:24 PM.

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