Solved

IF(OR  Statement in Excel

Posted on 2012-03-29
2
398 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
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…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

776 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