Solved

Excel-THe If statement

Posted on 2016-10-28
2
20 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 13

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Excel - Row Height +1 VBA 2 24
Excel formula 6 23
Formula to convert ranked data 2 11
MIN, using ARRAY 4 17
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…
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.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

743 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

13 Experts available now in Live!

Get 1:1 Help Now