Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / August 2006

Tip: Looking for answers? Try searching our database.

returning value if month is January

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jermsalerms - 18 Aug 2006 18:34 GMT
I have a list of data (1000 rows).
Each row has several columns containing information on a give
transaction.

column F contains the date of the transaction (mm/dd/yyyy format.)
column M contains a dollar amount.

I have two formulas that I need to make that i am not sure how t
handle.

1. I want formula that will count all the cells in column F that have
month of January and give me a total for the number of rows that contai
this. I tried: =COUNTIF(F2:F1000,MONTH(1)) but it did not work.

2. I want a formula that will add up the sum ($) of all the cells i
column M if the month in column F is January
Die_Another_Day - 18 Aug 2006 18:46 GMT
Try these array formulas, I'm sure that SumProduct could do it but I
suck at using SumProduct.

1. =SUM(IF(MONTH(F2:F1000)=1,1,0))
2. =SUM(IF(MONTH(F2:F1000)=1,M2:1000,0))

Make sure to press Ctrl+Shift+Enter after entering the formula into the
cell

Charles

> I have a list of data (1000 rows).
> Each row has several columns containing information on a given
[quoted text clipped - 18 lines]
> jermsalerms's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=30167
> View this thread: http://www.excelforum.com/showthread.php?threadid=573187
jermsalerms - 18 Aug 2006 18:59 GMT
the first one only returns a "1" even though there are about twenty wit
this month.

The 2nd one says there is an error in the formula.

Thanks for the suggestion. Does anyone else have an idea.

PS - I forgot to say that month must be Jan. and year must be 2006 i
both formulas. I dont want to count transactions from Jan of 2005 o
2004 etc
Bernard Liengme - 18 Aug 2006 19:02 GMT
Why not use SUMIF function?
Signature

Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

> Try these array formulas, I'm sure that SumProduct could do it but I
> suck at using SumProduct.
[quoted text clipped - 31 lines]
>> View this thread:
>> http://www.excelforum.com/showthread.php?threadid=573187
jermsalerms - 18 Aug 2006 19:22 GMT
not sure how I wold write that. Do you know
jermsalerms - 18 Aug 2006 19:47 GMT
Nice!!!

I did come up with another way to do it but this is much better an
quicke
Dave Peterson - 18 Aug 2006 19:16 GMT
=sumproduct(--(text(f2:f1000,"yyyymm")="200601"),m2:m1000)

Adjust the ranges to match--but you can't use whole columns.

=sumproduct() likes to work with numbers.  The -- stuff changes trues and falses
to 1's and 0's.

Bob Phillips explains =sumproduct() in much more detail here:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html

> I have a list of data (1000 rows).
> Each row has several columns containing information on a given
[quoted text clipped - 18 lines]
> jermsalerms's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=30167
> View this thread: http://www.excelforum.com/showthread.php?threadid=573187

Signature

Dave Peterson

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.