# Boards

## Excel question!

IF functions.

Want to do something like this:

=IF A1<0 and/or A2<0, 0, A3

but don't know how to do the and or bit. any help?

**Big Lad**-*Pro Rock*- The Fangasm: Kid A by
**Radiohead** **The KVB**-*Only Now Forever*- "The rules have changed, that's why I’m not following them": DiS Meets
**Youngr** - How To Organise A Music Festival #19:
**Ritual Union** **Richard Ashcroft**-*Natural Rebel***Adrianne Lenker**-*abysskiss*- "Making a secret band is quite strange when you think about it": DiS Meets
**Lights On Moscow**

IF functions.

Want to do something like this:

=IF A1<0 and/or A2<0, 0, A3

but don't know how to do the and or bit. any help?

that is an excel-ent question!!!!

## Don't need to if it is simple as that

because if it is the first one then it will return x and if it isn't but it is the second then it will return x again etc.

Just nest those ifs up mother fuck!

## the actual formula is way more complex than this.

this is where i am so far, it doesn't work but it's my attempt at the and/or problem:

=IF(E86-E97)ve tried to do an IF within an IF.

Is anyone following me? Is anyone listening.

## this is not what i typed

## =IF(E86-E97)<0,0,(E86-E97)*E98)

## why is this happening to me

can you do an IF within an IF?

## basically i want an IF that says:

IF profit is less than zero AND/OR cash is less than zero, then bladdy bla

## You don't need AND/OR because it makes no sense

you only need or because it doesn't matter if it is and! So just straight up nested if. Google the syntax and then feel like a winner when you have done it.

You can, google "nested if statements"

## You missing an open bracket there, my love.

## I'm not it's just not showing up in dis for same arse reason

## Nope

## Why

it's not reliant on it being and - it really just has to be or.

Stop trying to ruin Christmas, again.

## Based on how it was explained

It appears that a1<0 by itself should return x

## Fuck knows what he wants

let's leave this Haxballer to rot.

## Merry Christmas, smee!

## that is not what I typed

Damn you DIS formatting

a1<0 by itself should NOT return x

## and/or??

stop trolling

if A > 0

return

var = assign prompt('Quackers eggs')

else A /7

run.hypotenuse

.quackers { font-weight: bold;}

## not really sure exactly what you're trying to do, but this might help:

http://www.excelsage.org/the-magical-combination-of-if-and-or-functions/

## Just realised...

what the fuck are we doing helping this Haxball penoid?

## =IF(OR(A1<0),0,A3)

## FFS - stupid DiS

That's not what I wrote!

=IF(OR(A1 < 0, A2 < 0), 0, A3)

## Worked that time - ignore the first post

Cut out the integral part of the formula

## That is only an OR

when he seems to need AND/OR

## I'm giving Smee the BotD here

Christmas spirit and all that

## That fucks off playing Haxball and getting other people to do his work.

Unbelievable...

## *fuck's

## Now there is no need for that.

Disgusting.

## Not sure if you're being sarcastic or not...

Or in Excel is the same as And/Or

## The answer is

=IF(OR(AND(A1<0),0,B1)

## Damn you DIS formatting again

Using # in place of the less than sign

=IF(OR(AND(A1#0,A2#0),A2#0),0,A3)

## That formula is the equivalent of just

=IF(A2#0,0,A3)

The first condition in your OR statement is superfluous

## It is the way the question is framed

## Nope, that will evaluate false if only A1 is less than zero

= IF ( OR (A1 < 0, A2 < 0), 0, A3)

## That is how I interpreted what the question wanted

## I should probably do some work...

## No, it doesn't matter what the value of A1 is in that formula - it's only conditional on A2

=OR(False,True) will evaluate to True

And because the first statement is an And which involves the second statement, it can only ever be true when the second statement is true anyway

## Agreed

And the way the OP is worded the value of A1 is superfluous in the first place. I was preserving the superfluous syntax in the question, but it comes down to whether or not he has used and/or correctly to explain what he wanted.

=(IF(References!$B$2>H$5,SUMIF(Actual!$C:$C,Template!$B17&"-"&Template!$A$3&"-"&"900",Actual!G:G)+SUMIF(Actual!$C:$C,Template!$B17&"-"&Template!$A$3&"-"&"000",Actual!G:G),(SUMIF(Plan!$A:$A,Template!$B17&"-"&Template!$A$3&"-900",Plan!E:E)+SUMIF(Plan!$A:$A,Template!$B17&"-"&Template!$A$3&"-000",Plan!E:E))))