Using dates in Excel formulas

ashish514

New Member
Joined
Feb 10, 2011
Messages
47
I have long table which looks like this:[TABLE="class: grid, width: 300"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Date[/TD]
[TD]Order no.[/TD]
[TD]Value[/TD]
[TD]State[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

When I need to get a subtotal of the values state-wise I use the array forumula:

={Sum(if(D2:D200="Name of State",C2:C200,0))}

Now, when I use the same formula for a month-wise subtotal in following way,

={Sum(if(D2:D200="Name of Month",C2:C200,0))}

I am not getting the desired result. What is the right syntax to use for this purpose?
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
hi Ashish,

dont you think the column should be "A" and not "D" in your formula. column d has state in it ?
 
Upvote 0
Ahh....yes of course, The second forumula is ={Sum(if(A2:A200="Name of Month",C2:C200,0))}.

Thanks paddydive for pointing it out.
 
Upvote 0
Why not try a pivot table?

That would allow you to summarize the data by month/state/whatever.
 
Upvote 0
Why not try a pivot table?

That would allow you to summarize the data by month/state/whatever.

Not very well versed with pivot tables, but tried on your advice. It works too, only just a small glitch. How do I group the data monthwise? What I did is selected my table, dropped the date field to column labels and value field to values. The table is giving me date-wise sum of value. How do you get the month-wise sum of value??
 
Upvote 0
Right click the date field and select Group...

Then you should get various options of how to group.
 
Upvote 0

Forum statistics

Threads
1,226,693
Messages
6,192,471
Members
453,726
Latest member
JoeH57

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top