#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Stopping a formula

Another one

Is there anyway I can stop a formula mid way through so for example if I was
looking to sum up the below numbers until it finds the 6 and then stops..

1
4
6
8
10

so the sum would be 11 and wouldnt continue to sum the 8 and 10 (these
fields would continually change so the 6 would not remain in the same place)

Cheers


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default Stopping a formula

Hi

Will there be any values below 6 later in the series?
If not, then
=SUMIF(A:A,"<=6")

--
Regards
Roger Govier

"Roachy" wrote in message
...
Another one

Is there anyway I can stop a formula mid way through so for example if I
was
looking to sum up the below numbers until it finds the 6 and then stops..

1
4
6
8
10

so the sum would be 11 and wouldnt continue to sum the 8 and 10 (these
fields would continually change so the 6 would not remain in the same
place)

Cheers


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Stopping a formula

Hi Roger,

Yes im afraid the values will be pretty random so the below formula wont
work is there another way around this?

Cheers for you help

"Roger Govier" wrote:

Hi

Will there be any values below 6 later in the series?
If not, then
=SUMIF(A:A,"<=6")

--
Regards
Roger Govier

"Roachy" wrote in message
...
Another one

Is there anyway I can stop a formula mid way through so for example if I
was
looking to sum up the below numbers until it finds the 6 and then stops..

1
4
6
8
10

so the sum would be 11 and wouldnt continue to sum the 8 and 10 (these
fields would continually change so the 6 would not remain in the same
place)

Cheers


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 846
Default Stopping a formula

Not the ideal, but here is one way
Create a helper column (my work is in a2:b8)

= 1 1
=IF(AND(B2<6,A2=1),1,0) 4
=IF(AND(B3<6,A3=1),1,0) 6
=IF(AND(B4<6,A4=1),1,0) 10
=IF(AND(B5<6,A5=1),1,0) 15
=IF(AND(B6<6,A6=1),1,0) 6
=IF(AND(B7<6,A7=1),1,0) 12

Then in D2 I have
=SUMPRODUCT(A2:A8,B2:B8)

Adjust as needed.

This assumes that the six is not the first number....

This could be modified as well.
--
Wag more, bark less


"Roachy" wrote:

Another one

Is there anyway I can stop a formula mid way through so for example if I was
looking to sum up the below numbers until it finds the 6 and then stops..

1
4
6
8
10

so the sum would be 11 and wouldnt continue to sum the 8 and 10 (these
fields would continually change so the 6 would not remain in the same place)

Cheers


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
Protect macro from stopping saman110 via OfficeKB.com Excel Discussion (Misc queries) 1 August 16th 07 08:22 PM
Stopping spreadsheet save John New Users to Excel 2 September 15th 06 09:19 AM
Stopping copying from a webpage Tadhg Excel Discussion (Misc queries) 1 June 28th 06 07:09 PM
Stopping Calculation Kelly Excel Discussion (Misc queries) 2 March 15th 06 10:56 PM
stopping code from looping tjb Excel Worksheet Functions 3 December 7th 05 02:02 AM


All times are GMT +1. The time now is 06:01 PM.

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

About Us

"It's about Microsoft Excel"