Solved

IF(OR  Statement in Excel

Posted on 2012-03-29
2
397 Views
Last Modified: 2012-03-29
I am having a problem with the if(Or statement in Excel

I am trying to assign the value of "1" to a column B  if column Z is equal to "FE" or "GE" or "HE" or "IE"   and a value of "0" if it is not.

This statement is giving me a "0" at all times.   What is the correct code.

=IF(OR(Z29="FE",Z29="GE",Z29="HE",Z29="IE"),1,0)
0
Comment
Question by:morinia
2 Comments
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 255 total points
ID: 37781958
That is correct, though you can simplify it to:

=IF(OR(Z29={"FE","GE","HE","IE"}),1,0)

are you sure you don't have any leading or trailing spaces in the cells you are checking, for example?
0
 

Author Comment

by:morinia
ID: 37782034
Thanks for the shorter version,  My formula did work, it just had not finished calculating.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now