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 May 15th, 2002, 10:05 AM   #1
EyzOnFire
New Member
 
Join Date: May 2002
Location: Minnesota
Posts: 4
Default

I can't seem to find the right formula to add hours based on the criteria that it is Jan or Feb, etc...

i've tried Sumif, but can't get the Criteria right.

Please help!
Thanks,
Eyz
EyzOnFire is offline   Reply With Quote
Old May 15th, 2002, 10:14 AM   #2
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-05-15 09:05, EyzOnFire wrote:
I can't seem to find the right formula to add hours based on the criteria that it is Jan or Feb, etc...

i've tried Sumif, but can't get the Criteria right.

Please help!
Thanks,
Eyz
In which columns are your dates and hours to sum? Tell also at which they start.

Aladin Akyurek is offline   Reply With Quote
Old May 15th, 2002, 10:16 AM   #3
Asala42
Board Regular
 
Join Date: Feb 2002
Location: Southfield,MI USA
Posts: 1,027
Default

Hey there,

Are you pretty much just trying to do a sum by month? Pivot tables can be real handy for this sort of thing. But a formula approach would be:

=SUMIF(A2:A100,"Jan",B2:B100)

...if you had the word "JAN" written out in ColA. Another one would be:


=SUMPRODUCT((MONTH(A2:A100)=1)*(B2:B100))

..if you have real dates in ColA and the sum data in ColB.

Hope that helps a bit,
Adam
Asala42 is offline   Reply With Quote
Old May 15th, 2002, 10:43 AM   #4
EyzOnFire
New Member
 
Join Date: May 2002
Location: Minnesota
Posts: 4
Default

Thank you both...

1 column has hours totaled from another page
1 column has dates in date format (01/01/99 to current date)
on another page i'm running stats

Total hours for January, etc

i used
=SUMIF('Cases Summary'!E2:E36,MONTH(>="01/01/02"<="01/31/02"),'Cases Summary'!N2:N36)

i've changed the Month criteria a million times and can't find a proper statement!...

do i use the same method you suggested to get my totals?

would a pivot table be a better solution for the long run? (this data will grow to millions of lines of data, right now it is just in the hundreds)

Thanks again,
eyz
EyzOnFire is offline   Reply With Quote
Old May 15th, 2002, 10:59 AM   #5
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-05-15 09:43, EyzOnFire wrote:
Thank you both...

1 column has hours totaled from another page
1 column has dates in date format (01/01/99 to current date)
on another page i'm running stats

Total hours for January, etc

i used
=SUMIF('Cases Summary'!E2:E36,MONTH(>="01/01/02"<="01/31/02"),'Cases Summary'!N2:N36)

i've changed the Month criteria a million times and can't find a proper statement!...

do i use the same method you suggested to get my totals?

would a pivot table be a better solution for the long run? (this data will grow to millions of lines of data, right now it is just in the hundreds)

Thanks again,
eyz
Insert a new column next to E in Cases Summary if current column F is not free.

In F2 enter:

=MONTH(E2)

Give a double click on the fill handle of F2.

Create first in a column range, say, in A from A2 on the month numbers in the sheet where you tried your original SUMIF formula.

In B2 enter:

=SUMIF('Cases Summary'!$F$2:$F$36,A2,'Cases Summary'!$N$2:$N$36)

Custom format the formula cell as [h]:mm then copy it down for 12 rows.

Millions... I don't think that's possible to pour it to PivotTables without any aggregation first. A formula-based system to process such an amount of data would require aggregation too. You should probably consider using a database system like Access.

Aladin


[ This Message was edited by: Aladin Akyurek on 2002-05-15 11:42 ]

[ This Message was edited by: Aladin Akyurek on 2002-05-15 11:43 ]
Aladin Akyurek is offline   Reply With Quote
Old May 15th, 2002, 11:04 AM   #6
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

Quote:
...would a pivot table be a better solution for the long run? (this data will grow to millions of lines of data, right now it is just in the hundreds)

Thanks again,
eyz
A PivotTable would be ideal. You can source a PivotTable from external data. You can also Group your dates by month.
Mark W. is offline   Reply With Quote
Old May 15th, 2002, 12:37 PM   #7
EyzOnFire
New Member
 
Join Date: May 2002
Location: Minnesota
Posts: 4
Default

USING
on 1 page in column Q: =MONTH(E2)(got numbers for the month...looks accurate)I copied down the column(double clicking didn't do anything when i double clicked on column head)

on second step
you asked to go back to page of original formula and go to column (where the totals are supposed to be)... i'm not sure what you wanted me to do here

on third step
in Feb column (i'm assuming your B2) i entered your formula:
=SUMIF('Cases Summary'!Q2:Q36,A2,'Cases Summary'!N2:N36)

i formated the cell as directed and copied over

Result:
well...i got a number in Feb column but it was not the accurate total hours for the column in the other page... the rest of the month columns were zeros.

and the system does not like the MONTH(>="01/01/02"<="01/31/02) formula...


eyz
EyzOnFire is offline   Reply With Quote
Old May 15th, 2002, 12:54 PM   #8
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

May I suggest re-reading my post: I edited a bit.


on 1 page in column Q: =MONTH(E2)(got numbers for the month...looks accurate)I copied down the column(double clicking didn't do anything when i double clicked on column head)


Fill handle is the little black square in the lower right of the cell. I said column F. If you've done in Q, adjust the formula given in my original post.

on second step
you asked to go back to page of original formula and go to column (where the totals are supposed to be)... i'm not sure what you wanted me to do here

Substitute the new formula I suggested in lieu of your own version.

on third step
in Feb column (i'm assuming your B2) i entered your formula:
=SUMIF('Cases Summary'!Q2:Q36,A2,'Cases Summary'!N2:N36)


We need to lock the ranges before we can copy down (I had forgotten that in my unedited post). Change this to:

=SUMIF('Cases Summary'!$Q$2:$Q$36,A2,'Cases Summary'!$N$2:$N$36)

Now it will work.


and the system does not like the MONTH(>="01/01/02"<="01/31/02) formula...


Of course not. That needs a different syntax. But now you don't need that because you have a month column built on your date column.

Aladin Akyurek is offline   Reply With Quote
Old May 15th, 2002, 01:25 PM   #9
EyzOnFire
New Member
 
Join Date: May 2002
Location: Minnesota
Posts: 4
Default

Aladin...
thank you so much for your help...and i don't want to seem dimwitted but...

this is still not working

the totals page is not working

i have heading down the left...and headings across the top

columsn A and B appear like this:
Totals
Total Number Case Hours 99.55
Avg Hours per Case 2.84
Total Number Cases 35
Avg Cases per month
Open Cases
Closed Cases
Total Cases Accepted 27
Total Cases Denied 6
then in the next 12 columns (C-N) i want monthly breakdowns of the above totals

the function in C3 should be?

i have the function in D3 done and copied...but it refers to C3...so... what is the first function?

eyz


[ This Message was edited by: EyzOnFire on 2002-05-15 12:41 ]

[ This Message was edited by: EyzOnFire on 2002-05-15 12:44 ]
EyzOnFire is offline   Reply With Quote
Old May 15th, 2002, 01:44 PM   #10
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-05-15 12:25, EyzOnFire wrote:
Aladin...
thank you so much for your help...and i don't want to seem dimwitted but...

this is still not working

the totals page is not working

i have heading down the left...and headings across the top (Break down for Jan(C3), Feb(D3), etc...)

it appears like this:
Total Jan Feb
Total Number Case Hours 99.55
Avg Hours per Case 2.84
Total Number Cases 35
Avg Cases per month
Open Cases
Closed Cases
Total Cases Accepted 27
Total Cases Denied 6
the function in C3 should be?

i have the function in D3 done and copied...but it refers to C3...so... what is the first function?

eyz
Here is an example that illustrates your problem as I understood it:

I asked you to create an additional column to compute months from dates in the sheet where you have hours that you want to total per month in a different sheet:

Microsoft Excel - Book11_______________Running: xl2000 : OS = Windows (32-bit) NT 5.00
(F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp
F4=
*ABCD
1datemonthhours*
21/2/2002:alert('=MONTH(A2)')>112:45*
31/5/2002:alert('=MONTH(A3)')>110:30*
42/7/2002:alert('=MONTH(A4)')>212:24*
53/8/2002:alert('=MONTH(A5)')>323:56*
63/13/2002:alert('=MONTH(A6)')>312:08*
7****
Sheet1

To see the formula in the cells just click on the cells hyperlink

The above image was automatically generated by [HtmlMaker V1.22]
If you want this code, click here and Colo will email the file to you.
This code was graciously allowed to be modified: by Ivan F Moala All credit to Colo


The following figure shows how to use SUMIF to compute the desired totals in a different sheet:

Microsoft Excel - Book11_______________Running: xl2000 : OS = Windows (32-bit) NT 5.00
(F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp
A1=Month
*ABCD
1MonthTotal**
21:alert('=SUMIF(Sheet1!$B$2:$B$6,A2,Sheet1!$C$2:$C$6)')>23:15**
32:alert('=SUMIF(Sheet1!$B$2:$B$6,A3,Sheet1!$C$2:$C$6)')>12:24**
43:alert('=SUMIF(Sheet1!$B$2:$B$6,A4,Sheet1!$C$2:$C$6)')>36:04**
54:alert('=SUMIF(Sheet1!$B$2:$B$6,A5,Sheet1!$C$2:$C$6)')>0:00**
65:alert('=SUMIF(Sheet1!$B$2:$B$6,A6,Sheet1!$C$2:$C$6)')>0:00**
76:alert('=SUMIF(Sheet1!$B$2:$B$6,A7,Sheet1!$C$2:$C$6)')>0:00**
87:alert('=SUMIF(Sheet1!$B$2:$B$6,A8,Sheet1!$C$2:$C$6)')>0:00**
98:alert('=SUMIF(Sheet1!$B$2:$B$6,A9,Sheet1!$C$2:$C$6)')>0:00**
109:alert('=SUMIF(Sheet1!$B$2:$B$6,A10,Sheet1!$C$2:$C$6)')>0:00**
1110:alert('=SUMIF(Sheet1!$B$2:$B$6,A11,Sheet1!$C$2:$C$6)')>0:00**
1211:alert('=SUMIF(Sheet1!$B$2:$B$6,A12,Sheet1!$C$2:$C$6)')>0:00**
1312:alert('=SUMIF(Sheet1!$B$2:$B$6,A13,Sheet1!$C$2:$C$6)')>0:00**
Sheet2

To see the formula in the cells just click on the cells hyperlink

The above image was automatically generated by [HtmlMaker V1.22]
If you want this code, click here and Colo will email the file to you.
This code was graciously allowed to be modified: by Ivan F Moala All credit to Colo






[ This Message was edited by: Aladin Akyurek on 2002-05-15 12:45 ]
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 08:51 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