Solved

IF(OR  Statement in Excel

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

756 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