Month Formula

FinancialAnalystKid

Well-known Member
Joined
Oct 14, 2004
Messages
779
I'm brain dead today. It's raining and it's friday and I have a SIX day weekend coming up so help me! Just 6 more hours of work to go... LOL

Two issues:

Issue 1.
I have dates in my sheet. 1/1/2004 format. I need another a formula to point to it and give me month and year like Jan 2004.

*basically I'm just pointing to it but I want it to omit DAY from it's 'memory' if that makes sense.

This cell is being referenced in another sheet with a sumproduct formula to gather all infor for that month and year.

Issue B.
Will I be able to use the sumproduct if it points to the formula with the result or will I have to change the results to text? The reason is the column of months are labeled Jan 2004 in text format. Hence my point "*" above.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

texasalynn

Well-known Member
Joined
May 19, 2002
Messages
8,458
Can you give a little detail. Not understanding what you mean about the sumproduct issue?

Also you create formula to the date
=+A1
then format it for just the month year

texasalynn
 
Upvote 0

Zack Barresse

MrExcel MVP
Joined
Dec 9, 2003
Messages
10,881
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
  2. Mobile
  3. Web
ADVERTISEMENT
Remember, it's a date. This makes it a number to Excel, which can take any variety of shapes/sizes (formats). If you point to that cell, it will be pointing at a number, not text. You'd have to use the TEXT function (as Barrie/Seti points out) to look at just the Text.

It's much like looking at dates in VBA, if you want to look at the cell text you must use the .Text method instead of the .Value method. Make sense?
 
Upvote 0

Guitarde

Board Regular
Joined
Mar 18, 2003
Messages
238
Sumproduct will work if you add other columns for Year & Month, no need to convert these to text.

Regards
Eric
 
Upvote 0

Guitarde

Board Regular
Joined
Mar 18, 2003
Messages
238
ADVERTISEMENT
Other option if you want to go out for your week end now.

January 1st 2004 = 37987
January 1st 2005 = 38353

so you can just use these values into your sumproduct formula
=sumproduct((date>=37987)*(date<38353)*(qty)) 'This would add all 2004 qty


If you want totals by month them just change the min & max dates into the formula, in that case you just put these dates into cells & keep the same formula across your spreadsheet.

So at the end the conclusion is that you don't need new columns with Month & Year.

As far showing the date like Jan 2004 this can be done with cell formatting, again no need to add another column.
 
Upvote 0

TTom

Well-known Member
Joined
Jan 19, 2005
Messages
518
If you need a fomula, not in marco, I use this...
Assumes your full date is in cell A1

=CONCATENATE(MONTH(A1),"/",YEAR(A1))

TTom
 
Upvote 0

Forum statistics

Threads
1,195,972
Messages
6,012,622
Members
441,715
Latest member
TTP

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
Top