>=< and so on

  • Thread starter Thread starter denv
  • Start date Start date
D

denv

Hello
I know this sounds basic but I want to do an IF something like this:
=IF a1-b1=less than 7 but more than 0, what is the correct written form
for this?
Thank You
 
Hi Denv

Array enter (ctrl-shft-enter) this

=IF(A1-B1<0,"",IF(A1-B1>7,"",A1-B1))

Adjust to suit

Yours,
Mathew
Hello
I know this sounds basic but I want to do an IF something like this:
=IF a1-b1=less than 7 but more than 0, what is the correct written form
for this?
Thank You



------------------------------------------------
 
There's no need to array-enter the formula you posted. In each math operation (comparison,
subtraction) both operands are single cells, not ranges.

If the OP wanted the sum of the difference across, say, 10 rows, e.g. ranges A1:A10 and B1:B10,
then you WOULD need an array formula, i.e.

=SUM((A1:A10-B1:B10>0)*(A1:A10-B1:B10<7)*(A1:A10-B1:B10))

or you could use SUMPRODUCT for this example

=SUMPRODUCT((A1:A10-B1:B10>0)*(A1:A10-B1:B10<7)*(A1:A10-B1:B10))
 
Back
Top