Solved

Excel-THe If statement

Posted on 2016-10-28
2
30 Views
Last Modified: 2016-11-27
Having trouble with the IF statement and OR logic.   Need if(a1="A" or "B",1,0)   I get and error.  

Need help with this statement and OR logic in general.

Thank You
Dan
0
Comment
Question by:Malibucompany
2 Comments
 
LVL 21

Accepted Solution

by:
Ejgil Hedegaard earned 500 total points
ID: 41864625
All functions in Excel are build the same way Function(Argument1, Argument2, Argument3, etc.)
First the function to use is set, and then follow the arguments, separated by comma.
The argument list start after ( and the function ends with ).
The IF function has 3 arguments, Condition, Do when condition is true, Do when condition is false.
The OR function can have a number of arguments, but the function itself must be specified before the arguments.
So the OR function will be like this OR(A1="A", A1="B"), and it can be continued with more arguments OR(A1="A", A1="B", A1="C", A1="D").
Even functions without arguments must have the start and end parenthesis, like PI().

Together
IF(OR(A1="A", A1="B"), 1, 0)
0
 
LVL 14

Expert Comment

by:frankhelk
ID: 41902945
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Accept: Ejgil Hedegaard (https:#a41864625)

If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

frankhelk
Experts-Exchange Cleanup Volunteer
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

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

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