IF

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,

i have a cell in my worksheet that i am trying to do someting with ...
trying to add "AND" in the IF statement calculation

IF(sheet!B3 = "(ALL)", "specific", sheet!B3)

I tried the follwing but got an error:
IF(sheet!B3 = "(ALL)" AND sheet!W3 = "(ALL)", "specific", sheet!B3)

how can i add the "AND"?

thanks in advance,
geebee
 
It's not very intuitive, but it goes like this:

If(And(Condition1,Condition2,Condition3),Then,Else).

The "Or" function works the same way.

This is not how it would be done if you were using VBA code, but that's how
it's done for the Excel function.

It's important to have your parentheses in the right place too, especially
when using the "Or" function, and when mixing "And" and "Or" functions.

Hope this helps.

Keith
 
hi,

i have a cell in my worksheet that i am trying to do someting with ...
trying to add "AND" in the IF statement calculation

IF(sheet!B3 = "(ALL)", "specific", sheet!B3)

I tried the follwing but got an error:
IF(sheet!B3 = "(ALL)" AND sheet!W3 = "(ALL)", "specific", sheet!B3)

how can i add the "AND"?

thanks in advance,
geebee

The and-functions takes both arguments and returns true or false, then
the if-functions check for true or false,
like this:
=IF(AND(B3="all";W3="all");"Specific";B3)

Per Erik
 
applying Keithlo's explanation, you get.

IF(AND(Sheet!B3="(ALL"), Sheet!W3 = "(ALL"), "specific", Sheet!B3)

Shouldn't that be like Sheet1!B3 or Sheet2!B3 etc. ? Or does that mean
ActiveSheet in Excel speak?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top