Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 14
Default 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.

  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 11,501
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2,344
Default 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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare a cell to a range of cells? Cam Excel Discussion (Misc queries) 2 January 24th 08 05:35 AM
how to compare 2 cells in range tomek gomek Excel Worksheet Functions 4 July 20th 07 01:37 PM
compare the contents of one range of cells with the contents of a. Dozy123 Excel Discussion (Misc queries) 1 January 24th 07 10:14 AM
How do I compare cells and if FALSE compare to next cell in EXCEL Cindie Excel Worksheet Functions 0 March 24th 06 05:29 PM
Compare range with another range in other workbook Arjan Excel Worksheet Functions 2 November 15th 05 03:31 PM


All times are GMT +1. The time now is 07:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"