# Software

## Question

Locked

### Excel - using the IF function

By ·
I wonder if there is a wonderful tech person out there that could help me with a problem I'm having in Excel.

What I'm trying to do is: in cell AK2, if the value for cell AJ2 is 0, then for it to show 0, however, if it is more than/or equal to 1, then it should deduct cell AJ2 from AI1. This is the formula that I've tried to use and it is telling me I'm useless and that I should just put the laptop in the bin.

=IF(AJ2,0,0), IF(AJ2,>1,(AI2-AJ2))

Thanks,

Donna

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)
| Thread display: Collapse - | Expand +

Collapse -

by In reply to Excel - using the IF func ...

=IF(AJ2=0,0,(AJ2-AI1))

Is the formula you want to use. Basically, what that says is If AJ2 equals 0, then I will return 0. If it does not equal 0, I will return (AJ2-AI1). Mind you, this doesn't have a constraint about keeping the target cell a positive value. it only looks at whether AJ2 is zero or non-zero.

Collapse -

### Try this

by In reply to Excel - using the IF func ...

=IF(AJ2=0,0,IF(AJ2>=1,(AJ2-AI2),"Error"))

In place of error you need to put in what you want to happen when AJ2 is between 0 and 1 exclusive (i.e. 0.5). Or if you KNOW AJ2 will never be other than 0, or 1 and greater then don't worry about it.

Back to Software Forum
3 total posts (Page 1 of 1)