Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Year as well as month in formula

How can I include the year in this formula?

SUM(IF([Referrals10.xls]Referrals!$D$4:$D$250='[Referrals10.xls]Referral
Source'!$A5,IF([Referrals10.xls]Referrals!$J$4:$J$250=MONTH(B$2),1,0)))
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Year as well as month in formula

Are there DATES in this range:

[Referrals10.xls]Referrals!$J$4:$J$250

Are you wanting to compare the month of the date in
[Referrals10.xls]Referrals!$J$4:$J$250 to the month of the date in B2? If
so, then this is incorrect:

IF([Referrals10.xls]Referrals!$J$4:$J$250=MONTH(B$2)

It should be:

IF(MONTH([Referrals10.xls]Referrals!$J$4:$J$250)=MONTH(B$2)

To include a test for the year number:

IF(YEAR([Referrals10.xls]Referrals!$J$4:$J$250)=YEAR(B$2)

You can do this without the array SUM(IF...

Normally entered:

=SUMPRODUCT(--([Referrals10.xls]Referrals!$D$4:$D$250='[Referrals10.xls]Referral
Source'!$A5),--(MONTH([Referrals10.xls]Referrals!$J$4:$J$250)=MONTH(B$2)),--(YEAR([Referrals10.xls]Referrals!$J$4:$J$250)=YEAR(B$2)))

--
Biff
Microsoft Excel MVP


"Saylindara" wrote in message
...
How can I include the year in this formula?

SUM(IF([Referrals10.xls]Referrals!$D$4:$D$250='[Referrals10.xls]Referral
Source'!$A5,IF([Referrals10.xls]Referrals!$J$4:$J$250=MONTH(B$2),1,0)))



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Year as well as month in formula

Thank you for your very quick and helpful response.

"T. Valko" wrote:

Are there DATES in this range:

[Referrals10.xls]Referrals!$J$4:$J$250

Are you wanting to compare the month of the date in
[Referrals10.xls]Referrals!$J$4:$J$250 to the month of the date in B2? If
so, then this is incorrect:

IF([Referrals10.xls]Referrals!$J$4:$J$250=MONTH(B$2)

It should be:

IF(MONTH([Referrals10.xls]Referrals!$J$4:$J$250)=MONTH(B$2)

To include a test for the year number:

IF(YEAR([Referrals10.xls]Referrals!$J$4:$J$250)=YEAR(B$2)

You can do this without the array SUM(IF...

Normally entered:

=SUMPRODUCT(--([Referrals10.xls]Referrals!$D$4:$D$250='[Referrals10.xls]Referral
Source'!$A5),--(MONTH([Referrals10.xls]Referrals!$J$4:$J$250)=MONTH(B$2)),--(YEAR([Referrals10.xls]Referrals!$J$4:$J$250)=YEAR(B$2)))

--
Biff
Microsoft Excel MVP


"Saylindara" wrote in message
...
How can I include the year in this formula?

SUM(IF([Referrals10.xls]Referrals!$D$4:$D$250='[Referrals10.xls]Referral
Source'!$A5,IF([Referrals10.xls]Referrals!$J$4:$J$250=MONTH(B$2),1,0)))



.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Year as well as month in formula

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Saylindara" wrote in message
...
Thank you for your very quick and helpful response.

"T. Valko" wrote:

Are there DATES in this range:

[Referrals10.xls]Referrals!$J$4:$J$250

Are you wanting to compare the month of the date in
[Referrals10.xls]Referrals!$J$4:$J$250 to the month of the date in B2? If
so, then this is incorrect:

IF([Referrals10.xls]Referrals!$J$4:$J$250=MONTH(B$2)

It should be:

IF(MONTH([Referrals10.xls]Referrals!$J$4:$J$250)=MONTH(B$2)

To include a test for the year number:

IF(YEAR([Referrals10.xls]Referrals!$J$4:$J$250)=YEAR(B$2)

You can do this without the array SUM(IF...

Normally entered:

=SUMPRODUCT(--([Referrals10.xls]Referrals!$D$4:$D$250='[Referrals10.xls]Referral
Source'!$A5),--(MONTH([Referrals10.xls]Referrals!$J$4:$J$250)=MONTH(B$2)),--(YEAR([Referrals10.xls]Referrals!$J$4:$J$250)=YEAR(B$2)))

--
Biff
Microsoft Excel MVP


"Saylindara" wrote in message
...
How can I include the year in this formula?

SUM(IF([Referrals10.xls]Referrals!$D$4:$D$250='[Referrals10.xls]Referral
Source'!$A5,IF([Referrals10.xls]Referrals!$J$4:$J$250=MONTH(B$2),1,0)))



.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tell me which "season" (Month/Day through Month/Day) a date(Month/Day/Year) falls in (any year)??? misscrf Excel Discussion (Misc queries) 1 December 14th 07 02:59 PM
Date formula where month and day remain the same, but year will va Ann Excel Worksheet Functions 10 August 12th 07 03:35 PM
To detect month or days or year in if formula ShamsulZ Excel Discussion (Misc queries) 1 November 6th 06 07:47 AM
convert number to month and year in formula Soth Excel Worksheet Functions 3 July 19th 06 08:32 PM
trying to get day/month/year froamt while user enters year only RADIOOZ New Users to Excel 3 June 7th 06 05:30 AM


All times are GMT +1. The time now is 03:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"