 • 662K Members
• 10.7K Online
• 814K Conversations

## Excel Formula IF(AND(A1=0,B1=0),0,0),IF(A1&gt;B1,1,0) ends with #value error.

Highlighted
Occasional Visitor

# Excel Formula IF(AND(A1=0,B1=0),0,0),IF(A1&gt;B1,1,0) ends with #value error.

Hi,

I am using Excel 365. Using plain single sheet and cells A1 and B1. The formula is in C4 where I want the answer, Formula is IF(AND(A1=0,B1=0),0,0),IF(A1>B1,1,0). Always comes up with #VALUE error. I have made cell formats all numbers with one decimal place. I have tried making the values text "". It still comes up with #VALUE. I have separated the formula's and they both work fine stand alone. Using the tracer it goes correctly to the second formula  and gives the correct result but still says #Value in C4????

Highlighted

# Re: Excel Formula IF(AND(A1=0,B1=0),0,0),IF(A1&gt;B1,1,0) ends with #value error.

Your formula is =IF();IF(). That is not a valid formula.

It should be:

`=IF(AND(A1=0,B1=0),0,IF(A1>B1,1,0))`

A shorter way to achieve the same:

`=(A1>B1)*1 `