SOLVED

New Contributor

Greater than and less than functions

I need a cell (J4) to calculate a range of cells (E4:E73) and show the result in cell (J4).

If the individual cells are greater than 1.5 it needs to add the value of leftover amount, also if the individual cells are less than 1.5 I need it to subtract 1.5

7 Replies

Re: Greater than and less than functions

``=SUM(IF(E4:E74>1.5,E4:E74-1.5,E4:E74-1.5))``

You can try this formula. Enter the formula with ctrl+shift+enter if you don't work with Office365 or 2021.

Re: Greater than and less than functions

That works. The only problem I have now is I cant get it to ignore the blanks. If I enter " ", there are to many arguments for the function

Re: Greater than and less than functions

I am wondering if the cell is < 1.5 is it supposed to subtract 1.5 from the calculation OR subtract 1.5 from the cell value and add the difference to the calculation? If it is the latter as is what the above solution appears to give then can't you just do:
=SUM( range ) - COUNT( range)*1.5
which by the way will ignore spaces.
If it is the former then you need something like:
=SUMPRODUCT( ISNUMBER(range)*( (range>1.5)*(range - 1.5) - (range<1.5)*1.5))
BTW what should happen if the value is exactly 1.5?

Re: Greater than and less than functions

``=SUM(IF(NOT(ISBLANK(E4:E18)),IF(E4:E18>1.5,E4:E18-1.5,E4:E18-1.5)))``

You can try this formula which seems to exclude blank cells in my sheet. Enter the formula with ctrl+shift+enter if you don't work with Office365 or 2021.

Re: Greater than and less than functions

It is to subtract from the cell value and if it is 1.5 it can be ignored too. I am calculating "bank time" for our pilots. They must fly 1.5 on average for each period they fly. So if they fly 1.3 it would be -0.2. Also if they flew 2.4 it would add 0.9
best response confirmed by Sergei Baklan (MVP)
Solution

Re: Greater than and less than functions

so did you try =SUM( range ) - COUNT( range)*1.5
or if you are really just interested in the Average then why not:
=AVERAGE( range )
or the difference from the target average:
= AVERAGE( range ) - 1.5

Re: Greater than and less than functions

=SUM( range ) - COUNT( range)*1.5
WORKS!
I really appreciate the help and knowledge