MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Apr 14th, 2002, 08:03 AM   #1
met
New Member
 
Join Date: Apr 2002
Posts: 9
Default

pls help. i dont know what to do with this. i need total of weekly data.

Col A Col B Col C
04-1 3 04/1-7/02 = 6
04-7 3 04/8-14/02 = 7
04-12 2 04/15-21/02 = 5
04-13 5 04/22-28/02 = 0
04-16 4 04/29-30/02 = 8
04-20 1
04-29 6
04-30 2

thanks in advance

met


[ This Message was edited by: met on 2002-04-14 07:04 ]
met is offline   Reply With Quote
Old Apr 14th, 2002, 08:18 AM   #2
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-04-14 07:03, met wrote:
pls help. i dont know what to do with this. i need total of weekly data.

Col A Col B Col C
04-1 3 04/1-7/02 = 6
04-7 3 04/8-14/02 = 7
04-12 2 04/15-21/02 = 5
04-13 5 04/22-28/02 = 0
04-16 4 04/29-30/02 = 8
04-20 1
04-29 6
04-30 2

thanks in advance

met


[ This Message was edited by: met on 2002-04-14 07:04 ]
Lets say that your data start at row 2.

In C2 enter and copy down:

=WEEKNUM(A2)

Make a unique list of week numbers in D from D2 on.

In D1 enter:

=MATCH(9.99999999999999E+307,A:A)

In E2 enter and copy down:

=SUMIF(OFFSET($C$2,0,0,$D$1-1,1),D2,OFFSET($B$2,0,0,$D$1-1,1))

-1 in the $D$1-1 takes into account the fact that there is 1 row before the row where the actual data start.

Note. The above scheme is devised for the calendar weeks. WEEKNUM, if needed, can be made available by checking the Analysis Toolpak in Tools|Add-Ins.


[ This Message was edited by: aladin akyurek on 2002-01-14 13:49 ]
Aladin Akyurek is offline   Reply With Quote
Old Apr 16th, 2002, 10:39 AM   #3
met
New Member
 
Join Date: Apr 2002
Posts: 9
Default

is there a simplier way? thanks!

met
met is offline   Reply With Quote
Old Apr 16th, 2002, 10:51 AM   #4
Dave Patton
Board Regular
 
Join Date: Feb 2002
Location: Calgary, Alberta Canada
Posts: 2,065
Default



In an available column (or insert a column) calculate the weeknum.
I used column C =WEEKNUM(A2,2)

Enter a list of number like
14
15
16
18
In say Column D

Use Sumif

=SUMIF(C2:C9,D2,B2:B9)
Dave Patton is offline   Reply With Quote
Old Apr 16th, 2002, 11:13 AM   #5
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
Default

Hi met:
If I understood your requirement correctly, here is another approach ...
since you already have your weeks laid out in column C, use the formula

=SUMIF(C:C,"04/1-7/02",E:E) ... to get 6
for the week of "04/1-7/02"

HTH

__________________
Regards!

Yogi Anand, D.Eng, P.E.
Energy Efficient Building Network LLC
www.energyefficientbuild.com
Yogi Anand is offline   Reply With Quote
Old Apr 16th, 2002, 11:47 AM   #6
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-04-16 09:39, met wrote:
is there a simplier way? thanks!

met [img]/board/images/smiles/icon_smile.gif[/img]
I avoided a simpler SUMIF formula for a reason. I just reasoned that you will be adding more dates to column C. The formulas will respond to the additions appropriately, without any need for adjusting them. Using whole columns in SUMIF is inefficient. Using the actual ranges will require changing/editing the formula. It's up to you which you'd prefer to use.



Aladin
Aladin Akyurek is offline   Reply With Quote
Old Apr 19th, 2002, 09:52 PM   #7
met
New Member
 
Join Date: Apr 2002
Posts: 9
Default

what if i added another criteria, i want it by for ex, by sales agent and weekly? how would i do that?

met
met is offline   Reply With Quote
Old Apr 19th, 2002, 10:11 PM   #8
Dave Patton
Board Regular
 
Join Date: Feb 2002
Location: Calgary, Alberta Canada
Posts: 2,065
Default



Search the site for examples of using
SumProduct.

You could have included a concise clear example and your expected results.

What columns include real dates (not text)?
Do you want the formula to determine the weeks or are week numbers available?

Dave Patton is offline   Reply With Quote
Old Apr 20th, 2002, 07:05 AM   #9
met
New Member
 
Join Date: Apr 2002
Posts: 9
Default

my data includes real dates and collection payment of sales agent every week. my summary would look like this...
04/1-7/02 04/08-14/02 04/15-21/02
Agent A 500.00 0 350.00
Agent B 1000.00 500.00 0
Agent C 0 0 1500.00

i hope this would help...thanks

met

m really sorry...i cant align the columns!

[ This Message was edited by: met on 2002-04-20 06:06 ]
met is offline   Reply With Quote
Old Apr 20th, 2002, 10:16 AM   #10
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-04-20 06:05, met wrote:
my data includes real dates and collection payment of sales agent every week. my summary would look like this...
04/1-7/02 04/08-14/02 04/15-21/02
Agent A 500.00 0 350.00
Agent B 1000.00 500.00 0
Agent C 0 0 1500.00

i hope this would help...thanks

met

m really sorry...i cant align the columns!

[ This Message was edited by: met on 2002-04-20 06:06 ]

I'll assume that you have your data in A to C in a sheet called Data like the sample that follows:

{"Date","Agent","Amount";
37347,"A",3;
37353,"A",3;
37358,"B",2;
37359,"C",5;
37362,"A",4;
37366,"B",1;
37375,"B",6;
37376,"C",2}

and the actual data start at row 2. The above sample is in A1:C9.

In D1 enter: Week
In D2 enter and copy down:

=WEEKNUM(A2)

Note 1. WEEKNUM is available thru Analysis Toolpak (which, if needed, can be activated via Tools|Add-Ins).

I'll assume that the data area grows by new additions. Therefore we are going to define dynamic name ranges which you can also use in any other analysis of the data that you might want to carry out.

Activate Insert|Name|Define.
Enter NumRecs as name in the Names in Workbook box.
Enter as formula in the Refers to box:

=MATCH(9.99999999999999E+307,Data!$A:$A)

Note 2. The formula refers explicitly to the column that houses dates.

Activate Add. (Don't leave yet the Define Name window.)

Enter DataRecs as name in the Names in Workbook box.
Enter as formula in the Refers to box:

=NumRecs-(ROW(Data!$A$2)-1)

Activate Add. (Don't leave yet the Define Name window.)
Enter DATES as name in the Names in Workbook box.
Enter as formula in the Refers to box:

=OFFSET(Data!$A$2,0,0,DataRecs,1)

Activate Add. (Don't leave yet the Define Name window.)

Enter AGENTS as name in the Names in Workbook box.
Enter as formula in the Refers to box:

=OFFSET(Data!$B$2,0,0,DataRecs,1)

Activate Add. (Don't leave yet the Define Name window.)

Enter AMOUNTS as name in the Names in Workbook box.
Enter as formula in the Refers to box:

=OFFSET(Data!$C$2,0,0,DataRecs,1)

Activate Add. (Don't leave yet the Define Name window.)

Enter WEEKS as name in the Names in Workbook box.
Enter as formula in the Refers to box:

=OFFSET(Data!$D$2,0,0,DataRecs,1)

Activate OK.

Note 2. You can also give a name the whole area, DTable using the foregoing procedure with the formula:

=OFFSET(Data!$A$2,0,0,DataRecs,4).

Go now to a worksheet called Summary.

Enter in row 2 from B2 on: 04/1-7/02, 04/08-14/02, 04/15-21/02, etc.

Enter in B3:

=WEEKNUM(MIN(DATES))

Enter in C3 and copy across:

=B3+1

In B4 enter and copy across:

=COUNTIF(WEEKS,B3)

This gives you a weekly transaction count.

In B5 enter and copy across:

=SUMIF(WEEKS,B3,AMOUNTS)

This gives you a weekly transaction total.

Enter a unique list of agents from A6 on downwards (You can do this with Advanced Filter or manually).

In B6 enter:

=SUMPRODUCT((AGENTS=$A6)*(WEEKS=B$3),AMOUNTS)

This gives you weekly totals for each agent.

Copy this first across then down as far as needed.

Another method to get such a summary is by using Pivot Tables.

Aladin
Aladin Akyurek is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 11:52 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes