Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
If AND Statement
I have a number in Cell A1 and A2 for example.
I want a formula that says, that IF A1 and A2 are both Zero, then to place a zero in the the cell, if false divide A1/A2. Here is the formula i used but it obviously doesn't work =IF(A1=0 and A2=0,0,A1/A2) |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
If AND Statement
Use = IF( AND(A1=0,A2=0),0,A1/A2)
HTH "Lost and Looking for Help" wrote: I have a number in Cell A1 and A2 for example. I want a formula that says, that IF A1 and A2 are both Zero, then to place a zero in the the cell, if false divide A1/A2. Here is the formula i used but it obviously doesn't work =IF(A1=0 and A2=0,0,A1/A2) |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
If AND Statement
What you need is this:
=IF(AND(A1=0,A2=0),0,A1/A2) Hope this helps. Pete Lost and Looking for Help wrote: I have a number in Cell A1 and A2 for example. I want a formula that says, that IF A1 and A2 are both Zero, then to place a zero in the the cell, if false divide A1/A2. Here is the formula i used but it obviously doesn't work =IF(A1=0 and A2=0,0,A1/A2) |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
If AND Statement
Hi
When A1=0, then the result is zero anyway, except A2=0 too. When A1<0, but A2=0, then dividing retuns an error with checking you wanted. Probably you need a formula =IF(A2=0,0,A1/A2) -- Arvi Laanemets ( My real mail address: arvi.laanemets<attarkon.ee ) "Lost and Looking for Help" wrote in message ... I have a number in Cell A1 and A2 for example. I want a formula that says, that IF A1 and A2 are both Zero, then to place a zero in the the cell, if false divide A1/A2. Here is the formula i used but it obviously doesn't work =IF(A1=0 and A2=0,0,A1/A2) |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
If AND Statement
"Lost and Looking for Help"
wrote in message ... I have a number in Cell A1 and A2 for example. I want a formula that says, that IF A1 and A2 are both Zero, then to place a zero in the the cell, if false divide A1/A2. Here is the formula i used but it obviously doesn't work =IF(A1=0 and A2=0,0,A1/A2) You must take into account A2=0 =IF(NOT(A2),0,A1/A2) Bruno |
#6
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
If AND Statement
"Bruno Campanini" wrote in message
... "Lost and Looking for Help" wrote in message ... I have a number in Cell A1 and A2 for example. I want a formula that says, that IF A1 and A2 are both Zero, then to place a zero in the the cell, if false divide A1/A2. Here is the formula i used but it obviously doesn't work =IF(A1=0 and A2=0,0,A1/A2) You must take into account A2=0 =IF(NOT(A2),0,A1/A2) Can't you therefore say =IF(A2,A1/A2,0) ? -- David Biddulph |
#7
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
If AND Statement
"David Biddulph" wrote in message
... Can't you therefore say =IF(A2,A1/A2,0) ? -- David Biddulph Yes, of course. Saving 5 bytes... Bruno |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Returning Specific Cell Content using IF Statement | Excel Discussion (Misc queries) | |||
SET statement tutorial | Excel Discussion (Misc queries) | |||
If statement | Excel Discussion (Misc queries) | |||
Do I need a sumif or sum of a vlookup formula? | Excel Worksheet Functions | |||
How do I fix a circular reference in a financial statement? | Excel Discussion (Misc queries) |