Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
al al is offline
external usenet poster
 
Posts: 64
Default Count every group of numbers whose sum is zero & put formula next toeach number

I have the following numbers in column A
1
2
3
-2
-4
5
5
-10
3
3
-6

I need a formula in column B next to each number telling me to which
group of sum zero it belows i.e

1,2,3,-2,-4 would each have number 1 next to each of them in column B
(first group of sum zero)

5,5,-10 would each have number 2 next each of them in column B (second
group of sum zero)

3,3,-6 would each have number 3 next to each of them in column B
(third group of sun zero)

Pls help thxs
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 857
Default Count every group of numbers whose sum is zero & put formula next

Hi,

Here is a way to do it with 2 columns, it probably can be done with 1 but...

Assume your data start in A2, in B2 enter

=IF(SUM(A$2:A2)<0,1)

in C2 enter

=COUNTIF(B$2:B2,B1=TRUE)+B2

Copy down as far as necessary. Hide column B if desired.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"al" wrote:

I have the following numbers in column A
1
2
3
-2
-4
5
5
-10
3
3
-6

I need a formula in column B next to each number telling me to which
group of sum zero it belows i.e

1,2,3,-2,-4 would each have number 1 next to each of them in column B
(first group of sum zero)

5,5,-10 would each have number 2 next each of them in column B (second
group of sum zero)

3,3,-6 would each have number 3 next to each of them in column B
(third group of sun zero)

Pls help thxs

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
al al is offline
external usenet poster
 
Posts: 64
Default Count every group of numbers whose sum is zero & put formula nextto each number

On Mar 17, 6:14 am, al wrote:
I have the following numbers in column A
1
2
3
-2
-4
5
5
-10
3
3
-6

I need a formula in column B next to each number telling me to which
group of sum zero it belows i.e

1,2,3,-2,-4 would each have number 1 next to each of them in column B
(first group of sum zero)

5,5,-10 would each have number 2 next each of them in column B (second
group of sum zero)

3,3,-6 would each have number 3 next to each of them in column B
(third group of sun zero)

Pls help thxs


thxs shane !!! - exactly what i needed - do you know a bit about vba
macro -
can you give me a general macro which would achieve the same result if
i select the range of cells adjacent to the numbers sum of which need
to be zero - thxs
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
al al is offline
external usenet poster
 
Posts: 64
Default Count every group of numbers whose sum is zero & put formula next

On Mar 17, 7:51 am, Shane Devenshire
wrote:
Hi,

Here is a way to do it with 2 columns, it probably can be done with 1 but...

Assume your data start in A2, in B2 enter

=IF(SUM(A$2:A2)<0,1)

in C2 enter

=COUNTIF(B$2:B2,B1=TRUE)+B2

Copy down as far as necessary. Hide column B if desired.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire

"al" wrote:
I have the following numbers in column A
1
2
3
-2
-4
5
5
-10
3
3
-6


I need a formula in column B next to each number telling me to which
group of sum zero it belows i.e


1,2,3,-2,-4 would each have number 1 next to each of them in column B
(first group of sum zero)


5,5,-10 would each have number 2 next each of them in column B (second
group of sum zero)


3,3,-6 would each have number 3 next to each of them in column B
(third group of sun zero)


Pls help thxs


shane tried to combine the above formula into one but in vain - can
you pls help to get the formula into one column only txs
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default Count every group of numbers whose sum is zero & put formula next to each number

Hi,

You can try this as well:

1. Assign a heading to the range of nos., say Numbers in cell C4;
2. Type Number in cell D4;
3. In cell F5, enter the following formula =ISNUMBER(C5);
4. In cell D5, type 1;
5. In cell D5, use the following formula =DSUM($C$4:C6,D$4,$F$4:$F$5) and
copy down;
6. In cell E5, use the following formula =COUNTIF($D$4:D4,"0")+1 and copy
down

Hope this helps.

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"al" wrote in message
...
I have the following numbers in column A
1
2
3
-2
-4
5
5
-10
3
3
-6

I need a formula in column B next to each number telling me to which
group of sum zero it belows i.e

1,2,3,-2,-4 would each have number 1 next to each of them in column B
(first group of sum zero)

5,5,-10 would each have number 2 next each of them in column B (second
group of sum zero)

3,3,-6 would each have number 3 next to each of them in column B
(third group of sun zero)

Pls help thxs




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
al al is offline
external usenet poster
 
Posts: 64
Default Count every group of numbers whose sum is zero & put formula nextto each number

On Mar 17, 10:12 am, "Ashish Mathur" wrote:
Hi,

You can try this as well:

1. Assign a heading to the range of nos., say Numbers in cell C4;
2. Type Number in cell D4;
3. In cell F5, enter the following formula =ISNUMBER(C5);
4. In cell D5, type 1;
5. In cell D5, use the following formula =DSUM($C$4:C6,D$4,$F$4:$F$5) and
copy down;
6. In cell E5, use the following formula =COUNTIF($D$4:D4,"0")+1 and copy
down

Hope this helps.

--
Regards,

Ashish Mathur
Microsoft Excel MVPwww.ashishmathur.com

"al" wrote in message

...

I have the following numbers in column A
1
2
3
-2
-4
5
5
-10
3
3
-6


I need a formula in column B next to each number telling me to which
group of sum zero it belows i.e


1,2,3,-2,-4 would each have number 1 next to each of them in column B
(first group of sum zero)


5,5,-10 would each have number 2 next each of them in column B (second
group of sum zero)


3,3,-6 would each have number 3 next to each of them in column B
(third group of sun zero)


Pls help thxs


ashish i'm looking for something using formulas in 1 column only - can
you help pls
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 806
Default Count every group of numbers whose sum is zero & put formula next

Hello,

If A1 and B1 are empty and your data starts at A2, enter into B2:
=IF(ABS(SUM(A$1:A1))<0.0000000001,B1+1,B1)
and copy down.

Regards,
Bernd
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
al al is offline
external usenet poster
 
Posts: 64
Default Count every group of numbers whose sum is zero & put formula next

On Mar 17, 4:51 pm, Bernd P wrote:
Hello,

If A1 and B1 are empty and your data starts at A2, enter into B2:
=IF(ABS(SUM(A$1:A1))<0.0000000001,B1+1,B1)
and copy down.

Regards,
Bernd


great thxs a lot for that improved 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
How do I select a number from a specific group of numbers? motol Excel Worksheet Functions 2 August 24th 06 05:52 AM
Help! How do you get excel to find the x(changes daily, marked in a cell from another formula) highest numbers in a group of numbers and sum them up? C-Man23 Excel Worksheet Functions 3 January 19th 06 09:52 AM
Help! How do you get excel to find the x(changes daily, marked in a cell from another formula) highest numbers in a group of numbers and sum them up? C-Man23 Excel Worksheet Functions 1 January 9th 06 01:23 PM
count a group of numbers but do not count duplicates Lisaml Excel Worksheet Functions 2 January 26th 05 11:19 PM
Group by count formula nobrabbit Excel Worksheet Functions 1 November 7th 04 09:10 PM


All times are GMT +1. The time now is 03:36 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"