Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Calculating Sum question.

Hi,

I am new to Excel programming, and not sure if this even requires
macro or not, but here goes.

I want some function, combination of functions, or macros to scan th
first column under Name: and the second colum under Data:(see below).


Note: The name is consecutively sorted already.

If the names match the cell directly below it, then take the sum of th
respective Data: cells, and put the results in the column directly t
the right of that.

Then continue scanning the Name: and Data: columns. If there is n
match just copy the cell one over to the right Result cell. See Tes
B:

This will stop when a blank cell is encountered.


Name: Data: Result:
TEST A 100
TEST A 250 350
TEST B 50 50
TEST C 40
TEST C 50
TEST C 30 120

Any help will be greatly appreciated.

Thank you in advance,
JMO

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Calculating Sum question.

Assume you data starts in A1. In C2

put in the formula
=IF(AND(A2<A1,A2<A3),B2,IF(AND(A2=A1,A2<A3),SUM IF(A:A,A2,B:B),""))

then drag fill down your column.

in C1
=if(A1<A2,B1,"")

--
Regards,
Tom Ogilvy


"jmon " wrote in message
...
Hi,

I am new to Excel programming, and not sure if this even requires a
macro or not, but here goes.

I want some function, combination of functions, or macros to scan the
first column under Name: and the second colum under Data:(see below).


Note: The name is consecutively sorted already.

If the names match the cell directly below it, then take the sum of the
respective Data: cells, and put the results in the column directly to
the right of that.

Then continue scanning the Name: and Data: columns. If there is no
match just copy the cell one over to the right Result cell. See Test
B:

This will stop when a blank cell is encountered.


Name: Data: Result:
TEST A 100
TEST A 250 350
TEST B 50 50
TEST C 40
TEST C 50
TEST C 30 120

Any help will be greatly appreciated.

Thank you in advance,
JMON


---
Message posted from http://www.ExcelForum.com/



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
Calculating Question RJ Swain Excel Worksheet Functions 6 May 11th 07 12:03 AM
a tough question - calculating a number out of an alphanumeric code usingexcel Excel Discussion (Misc queries) 2 August 3rd 06 06:07 PM
Simple Question, Calculating Discounts WebLord Excel Worksheet Functions 3 March 17th 06 07:40 PM
Calculating averages excluding outliers...a question stew1901 Excel Worksheet Functions 4 November 29th 05 01:38 AM
Calculating basic averages...a question stew1901 Excel Worksheet Functions 5 November 29th 05 12:29 AM


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