Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Formula

0

It shows TRUE if they classify the order as High or Critical AND they have chosen Express Air as the mode of shipment. 

Which formula i can use for this statement?

Answer
Discuss

Answers

0
Selected Answer

In order to structure a reply you first of all need an object. In your example, the object is "priority". Once you have an object you can examine it. You can ask whether it is equal to something (or unequal). Here is the syntax for that.

[Priority] = "High"
[Priority] = "Critical"

It follows that IF [priority] = "High" Then [priority] <> "Critical" and v.v. Therefore you always have the choice which side of the same coin you want to look at. In programming, the better choice is to ask for the True rather than the False. Ask for what it is rather than what it is not. That's because, in fact, Excel's IF condition always asks for True. Like, "Is it true that the story is not true?" Just asking if the story is true gives the same result with less convolutions.

You can logically concatenate comparisons.

([Priority] = "High") OR ([Priority] = "Critical")

I have placed each comparison in its own parentheses. Excel doesn't always need that but it knows that parentheses must be resolved before doing further calculations. Writing them into the formula clarifies for both Excel and your reader. Each of the two comparisons in this example evaluates to either True or False, which the OR concatenator merges into one result.
True OR True = True,
True OR False = True,
False OR True = True,
False OR False = False.
The comparison with OR is True so long as one side is True.

In the second part of your task the object is [mode of shipment]. So, you evaluate 
([mode of shipment] = "express air") which will evaluate to either True or False. Again, Excel doesn't need the parentheses but doesn't mind them, either. I put them there for a reason which will become apparent in a moment.

Now that you have the design for all your comparisons in place the time has come to assemble them. The concatenator is logical AND. You want a single True or False from ([the result of the first concatenation]) AND ([the result of the last evaluation]). The parentheses show that there are only two items to compare. Or you might say the parentheses create a single result from a group of comparisons and allow you to compare that result with another. Here you go.

(([Priority] = "High") OR ([Priority] = "Critical")) AND ([mode of shipment] = "express air")

True AND True = True
True AND False = False
False AND True = False
False AND False = False.
The comparison with AND is only True if both sides are True.

Discuss


Answer the Question

You must create an account to use the forum. Create an Account or Login