Solved

Excel-THe If statement

Posted on 2016-10-28
2
45 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 23

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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

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.
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 …
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

617 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