ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Regarding Compare and SUm the Range of Cells (https://www.excelbanter.com/new-users-excel/203910-regarding-compare-sum-range-cells.html)

Raghu

Regarding Compare and SUm the Range of Cells
 
Hi
I have a range of data in Cloumn B2:B6
48
59
40
42
32


Now in the Column B7 i want to compare the data in each every cell if that
data is greater than 40 then it must substract from 40 and display in B7
For example : B2(i.e. 48) 40 so it must substract 48-40 =8
B3(i.e 59)40 so it must substract 59-40 = 19
B4 (i.e. 40) = 40 so there must not be any action on
this cell value

so the value in B7 must be 8+19+2=29

Can anyone suggest me how to use this formula.


Mike H

Regarding Compare and SUm the Range of Cells
 
Try this

=SUM(IF(B2:B640,B2:B6-40,""))

This is an array formula and must be entered with CTRL+Shift+Enter not just
enter. If you do it correctly Excel will put curly brackets around it {}. You
can't type these yourself.

Mike

"Raghu" wrote:

Hi
I have a range of data in Cloumn B2:B6
48
59
40
42
32


Now in the Column B7 i want to compare the data in each every cell if that
data is greater than 40 then it must substract from 40 and display in B7
For example : B2(i.e. 48) 40 so it must substract 48-40 =8
B3(i.e 59)40 so it must substract 59-40 = 19
B4 (i.e. 40) = 40 so there must not be any action on
this cell value

so the value in B7 must be 8+19+2=29

Can anyone suggest me how to use this formula.


ShaneDevenshire

Regarding Compare and SUm the Range of Cells
 
Hi,

Another approach:
=SUMPRODUCT((A1:A5-40)*(A1:A5=40))

--
Thanks,
Shane Devenshire


"Raghu" wrote:

Hi
I have a range of data in Cloumn B2:B6
48
59
40
42
32


Now in the Column B7 i want to compare the data in each every cell if that
data is greater than 40 then it must substract from 40 and display in B7
For example : B2(i.e. 48) 40 so it must substract 48-40 =8
B3(i.e 59)40 so it must substract 59-40 = 19
B4 (i.e. 40) = 40 so there must not be any action on
this cell value

so the value in B7 must be 8+19+2=29

Can anyone suggest me how to use this formula.



All times are GMT +1. The time now is 08:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com