#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
AAMIFC
 
Posts: n/a
Default SUMIF conditions

Hi
I have a work sheet with a number of years work by month and I would like to
sum all the like months depending on user input. I can do this with a SUMIF,
however the year is linked to the name tag. Eg

March 04 10
April 04 8
......
March 05 15
April 05 4
......
March 06 20
April 06 0
......

I would like to enter:
March
and return 45. I then enter April and return 12 as the answer. Is there
away to place a restriction on the array to be searched to look at say the
first three char?

thanks in Advance
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dav
 
Posts: n/a
Default SUMIF conditions


It can be done, but it is not entirely clear from your example how your
data is stored. Is the March 06 a date or a text string?

If it is a date and the dates are stored in b2:b5 and the values you
wish to sum are in c2:c5 try
=SUMPRODUCT((MONTH(B2:B5)=3)*(C2:C5))
3 being march

Or if you want to type mar
=SUMPRODUCT((TEXT(B2:B5,"mmm")="Mar")*(c2:c5))


If it is text
=SUMPRODUCT((LEFT(b2:b5,3)="Mar")*(c2:c5))

If you need to sum for each month you could just put the months in a
cells and reference that cell rather than type mar, apr etc

Regards
Dav


--
Dav
------------------------------------------------------------------------
Dav's Profile: http://www.excelforum.com/member.php...o&userid=27107
View this thread: http://www.excelforum.com/showthread...hreadid=522071

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default SUMIF conditions

Assuming the months are stored in date format
Let the range of month be a1:a50
let the range of tag be b1:b50
Let the cell where you wish to enter your value be c1

Then the array formula would be
{=SUM(IF(TEXT(A1:A50,"mmmm")=C1,B1:B50))}
Enter the formula and press ctrl+shift+enter to convert it into an
array formula

Substitute range a1:a50 and b1:b50 with your range
Instead of c1 you would directly edit as "march".
In case the values are stored as text simply change the forumula as
{=SUM(IF(A1:A50)=C1,B1:B50))}


For more,post your questions on
http://groups.google.co.in/group/answers-for-everything

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
AAMIFC
 
Posts: n/a
Default SUMIF conditions

Thanks - both of these work!!!



"AAMIFC" wrote:

Hi
I have a work sheet with a number of years work by month and I would like to
sum all the like months depending on user input. I can do this with a SUMIF,
however the year is linked to the name tag. Eg

March 04 10
April 04 8
.....
March 05 15
April 05 4
.....
March 06 20
April 06 0
.....

I would like to enter:
March
and return 45. I then enter April and return 12 as the answer. Is there
away to place a restriction on the array to be searched to look at say the
first three char?

thanks in Advance

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
SUMIF function with 2 conditions rlandlin Excel Worksheet Functions 4 September 28th 05 05:50 PM
sumif with 2 conditions ?? can this be done?? WTG Excel Worksheet Functions 2 July 4th 05 10:08 PM
SUMIF with two conditions Fred Holmes Excel Discussion (Misc queries) 3 May 1st 05 10:10 PM
sumif with two conditions ww Excel Worksheet Functions 3 March 31st 05 01:44 AM
SUMIF based on 2 conditions TimH Excel Worksheet Functions 3 October 28th 04 08:18 PM


All times are GMT +1. The time now is 05:52 AM.

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"