Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default Summing Group and insert value next to it

Hi

In column A, I have names that appear as ABC 01, ABC 02,ABC 03, I want to sum
the group ABC, XYZ or any other groups which appear in the column A and put
a value in column B depending on the sum total figure. For example, if the
total sum
for ABC is more than 100, all the entries in the column B related to ABC, ie
ABC 01, ABC 02, ABC 03.....so on, will have a Y in the respective rows,
otherwise, N will be input in the related entries.

Thanks in advance.

regards, xlsops
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Summing Group and insert value next to it

What do you mean by "I want to sum the group ABC"? What do you want to sum?
Do you want to sum all the numbers that appear after the ABC in the cells?
Or do you want to simply count the number of cells that contain ABC? HTH
Otto
"franciz" wrote in message
...
Hi

In column A, I have names that appear as ABC 01, ABC 02,ABC 03, I want to
sum
the group ABC, XYZ or any other groups which appear in the column A and
put
a value in column B depending on the sum total figure. For example, if the
total sum
for ABC is more than 100, all the entries in the column B related to ABC,
ie
ABC 01, ABC 02, ABC 03.....so on, will have a Y in the respective rows,
otherwise, N will be input in the related entries.

Thanks in advance.

regards, xlsops


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default Summing Group and insert value next to it

Hi,

Thanks for looking into this. Let me explain once again.

Let say I have Names in Column A such as ABC 01, ABCD 001, XY 0001 and
so on....the names can be varies in length, but we can identify by the group
name, like ABC xxx, XY xxx ...etc

In Column B, I have amount for related to each names. If the total sum of
the amount in a particular group, eg. all the names under ABC, is less than
100,
put a "N" in Column C of the corresponding rows, otherwise put a "Y" if the
amount is greater than 100.

Hope this make sense now. Thanks

regards,xlsops


"Otto Moehrbach" wrote:

What do you mean by "I want to sum the group ABC"? What do you want to sum?
Do you want to sum all the numbers that appear after the ABC in the cells?
Or do you want to simply count the number of cells that contain ABC? HTH
Otto
"franciz" wrote in message
...
Hi

In column A, I have names that appear as ABC 01, ABC 02,ABC 03, I want to
sum
the group ABC, XYZ or any other groups which appear in the column A and
put
a value in column B depending on the sum total figure. For example, if the
total sum
for ABC is more than 100, all the entries in the column B related to ABC,
ie
ABC 01, ABC 02, ABC 03.....so on, will have a Y in the respective rows,
otherwise, N will be input in the related entries.

Thanks in advance.

regards, xlsops



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Summing Group and insert value next to it

This macro will do what you want. I assumed that your data starts in A1.
You must place all of your group names somewhere in your file, select the
list, and name it "NamesList". Come back if you need more. HTH Otto
Sub SumGroup()
Dim i As Range, j As Range, rColA As Range
Dim TheSum As Double, YN As String
Set rColA = Range("A1", Range("A" & Rows.Count).End(xlUp))
Application.ScreenUpdating = False
For Each i In Range("NamesList")
TheSum = 0
For Each j In rColA
If InStr(j.Value, i.Value) < 0 Then _
TheSum = TheSum + j.Offset(, 1).Value
Next j
YN = "Y"
If TheSum <= 100 Then YN = "N"
For Each j In rColA
If InStr(j.Value, i.Value) < 0 Then _
j.Offset(, 2).Value = YN
Next j
Next i
Application.ScreenUpdating = True
End Sub

"franciz" wrote in message
...
Hi,

Thanks for looking into this. Let me explain once again.

Let say I have Names in Column A such as ABC 01, ABCD 001, XY 0001 and
so on....the names can be varies in length, but we can identify by the
group
name, like ABC xxx, XY xxx ...etc

In Column B, I have amount for related to each names. If the total sum of
the amount in a particular group, eg. all the names under ABC, is less
than
100,
put a "N" in Column C of the corresponding rows, otherwise put a "Y" if
the
amount is greater than 100.

Hope this make sense now. Thanks

regards,xlsops


"Otto Moehrbach" wrote:

What do you mean by "I want to sum the group ABC"? What do you want to
sum?
Do you want to sum all the numbers that appear after the ABC in the
cells?
Or do you want to simply count the number of cells that contain ABC? HTH
Otto
"franciz" wrote in message
...
Hi

In column A, I have names that appear as ABC 01, ABC 02,ABC 03, I want
to
sum
the group ABC, XYZ or any other groups which appear in the column A and
put
a value in column B depending on the sum total figure. For example, if
the
total sum
for ABC is more than 100, all the entries in the column B related to
ABC,
ie
ABC 01, ABC 02, ABC 03.....so on, will have a Y in the respective rows,
otherwise, N will be input in the related entries.

Thanks in advance.

regards, xlsops




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
Insert blank row macro after a break in a group Gord Dibben Excel Discussion (Misc queries) 0 November 5th 09 09:54 PM
Counting or summing up a group of cells with dates as datas Irene Excel Discussion (Misc queries) 3 September 26th 08 09:13 PM
Summing a group of numbers Barbie Da New Users to Excel 2 June 28th 08 10:36 PM
Summing columns after insert rows Tom Cote Excel Programming 2 June 21st 05 07:51 PM
Insert Row using Macro, Group By Date JRW[_2_] Excel Programming 3 September 5th 03 05:03 PM


All times are GMT +1. The time now is 05:37 AM.

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"