Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Sumproduct with two conditions(or more)

This is a formula that I have now

=sumproduct((B2:B2002)="Machine")*(Year(A2:A2002)= 2006)
*(Month(A2:A2002)=1)*J2:J2002)

this works great (thanks to every one on this forum)

any ways I would like to add another condition in there.I tried the
following but
holy what a number did I get

=sumproduct((B2:B2002="Machine")*(C2:C2002="Repair s")*(Year(A2:A2002)=2006)*(Month(A2:A2002)=1)*J2:J 2002)

any help in the right direction will be greatly apprec.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Sumproduct with two conditions(or more)

Why do you think your formula didn't work?

hellZg8 wrote:

This is a formula that I have now

=sumproduct((B2:B2002)="Machine")*(Year(A2:A2002)= 2006)
*(Month(A2:A2002)=1)*J2:J2002)

this works great (thanks to every one on this forum)

any ways I would like to add another condition in there.I tried the
following but
holy what a number did I get

=sumproduct((B2:B2002="Machine")*(C2:C2002="Repair s")*(Year(A2:A2002)=2006)*(Month(A2:A2002)=1)*J2:J 2002)

any help in the right direction will be greatly apprec.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Sumproduct with two conditions(or more)

I'm not entirerly sure. I guess I still don't quite understanding how the
formula is actually working.

It looks for the Value "Machine" in the Array1 (B2:B2002) and then finds the
Dates
in Array2 (A2:A2002) then sums the adjacent cells corresponding with Array's
1 & 2.

It almost looks as though it is summing everything up.

"Dave Peterson" wrote:

Why do you think your formula didn't work?

hellZg8 wrote:

This is a formula that I have now

=sumproduct((B2:B2002)="Machine")*(Year(A2:A2002)= 2006)
*(Month(A2:A2002)=1)*J2:J2002)

this works great (thanks to every one on this forum)

any ways I would like to add another condition in there.I tried the
following but
holy what a number did I get

=sumproduct((B2:B2002="Machine")*(C2:C2002="Repair s")*(Year(A2:A2002)=2006)*(Month(A2:A2002)=1)*J2:J 2002)

any help in the right direction will be greatly apprec.


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Sumproduct with two conditions(or more)

For testing purposes...

You could apply Data|Filter|autofilter to that range (all those columns).

Show just the cells with Machine in column b, just the cells with Repairs in
column C and just the January 2006 dates in column A.

Then put =subtotal(9,j:j) in a helper cell.

======
Or use a helper cell with a formula like:

=if(and(b2="machine",c2="repairs",text(a2,"yyyymm" )="200601"),j2,0)

and drag down the column.

Then sum that column.

It looks like your formula is ok to me--maybe there's just more stuff than you
think.


hellZg8 wrote:

I'm not entirerly sure. I guess I still don't quite understanding how the
formula is actually working.

It looks for the Value "Machine" in the Array1 (B2:B2002) and then finds the
Dates
in Array2 (A2:A2002) then sums the adjacent cells corresponding with Array's
1 & 2.

It almost looks as though it is summing everything up.

"Dave Peterson" wrote:

Why do you think your formula didn't work?

hellZg8 wrote:

This is a formula that I have now

=sumproduct((B2:B2002)="Machine")*(Year(A2:A2002)= 2006)
*(Month(A2:A2002)=1)*J2:J2002)

this works great (thanks to every one on this forum)

any ways I would like to add another condition in there.I tried the
following but
holy what a number did I get

=sumproduct((B2:B2002="Machine")*(C2:C2002="Repair s")*(Year(A2:A2002)=2006)*(Month(A2:A2002)=1)*J2:J 2002)

any help in the right direction will be greatly apprec.


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Sumproduct with two conditions(or more)

thanks for your response Dave

This is what I would like to do

sum all amounts in column J2:J2002 that match up with a certain machine and
for repairs only within a certain month.

Machine A Repairs Totals for Janurary = $$$$$

Do this for each Month, Quarter, and Year To Date

I have not yet tried your suggestion, thought maybe give a bit more clarity
to what I would like to achieve.
Tks in advance

"Dave Peterson" wrote:

For testing purposes...

You could apply Data|Filter|autofilter to that range (all those columns).

Show just the cells with Machine in column b, just the cells with Repairs in
column C and just the January 2006 dates in column A.

Then put =subtotal(9,j:j) in a helper cell.

======
Or use a helper cell with a formula like:

=if(and(b2="machine",c2="repairs",text(a2,"yyyymm" )="200601"),j2,0)

and drag down the column.

Then sum that column.

It looks like your formula is ok to me--maybe there's just more stuff than you
think.


hellZg8 wrote:

I'm not entirerly sure. I guess I still don't quite understanding how the
formula is actually working.

It looks for the Value "Machine" in the Array1 (B2:B2002) and then finds the
Dates
in Array2 (A2:A2002) then sums the adjacent cells corresponding with Array's
1 & 2.

It almost looks as though it is summing everything up.

"Dave Peterson" wrote:

Why do you think your formula didn't work?

hellZg8 wrote:

This is a formula that I have now

=sumproduct((B2:B2002)="Machine")*(Year(A2:A2002)= 2006)
*(Month(A2:A2002)=1)*J2:J2002)

this works great (thanks to every one on this forum)

any ways I would like to add another condition in there.I tried the
following but
holy what a number did I get

=sumproduct((B2:B2002="Machine")*(C2:C2002="Repair s")*(Year(A2:A2002)=2006)*(Month(A2:A2002)=1)*J2:J 2002)

any help in the right direction will be greatly apprec.

--

Dave Peterson


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Sumproduct with two conditions(or more)

You may want to look at Data|Pivottables.

There's lots of ways you can summarize your data, but using pivottables can make
it simpler.

If you want to read more about pivottables...

Here are a few links:

Debra Dalgleish's pictures at Jon Peltier's site:
http://peltiertech.com/Excel/Pivots/pivottables.htm
And Debra's own site:
http://www.contextures.com/xlPivot01.html

John Walkenbach also has some at:
http://j-walk.com/ss/excel/files/general.htm
(look for Tony Gwynn's Hit Database)

Chip Pearson keeps Harald Staff's notes at:
http://www.cpearson.com/excel/pivots.htm

MS has some at (xl2000 and xl2002):
http://office.microsoft.com/downloads/2000/XCrtPiv.aspx
http://office.microsoft.com/assistan...lconPT101.aspx

hellZg8 wrote:

thanks for your response Dave

This is what I would like to do

sum all amounts in column J2:J2002 that match up with a certain machine and
for repairs only within a certain month.

Machine A Repairs Totals for Janurary = $$$$$

Do this for each Month, Quarter, and Year To Date

I have not yet tried your suggestion, thought maybe give a bit more clarity
to what I would like to achieve.
Tks in advance

"Dave Peterson" wrote:

For testing purposes...

You could apply Data|Filter|autofilter to that range (all those columns).

Show just the cells with Machine in column b, just the cells with Repairs in
column C and just the January 2006 dates in column A.

Then put =subtotal(9,j:j) in a helper cell.

======
Or use a helper cell with a formula like:

=if(and(b2="machine",c2="repairs",text(a2,"yyyymm" )="200601"),j2,0)

and drag down the column.

Then sum that column.

It looks like your formula is ok to me--maybe there's just more stuff than you
think.


hellZg8 wrote:

I'm not entirerly sure. I guess I still don't quite understanding how the
formula is actually working.

It looks for the Value "Machine" in the Array1 (B2:B2002) and then finds the
Dates
in Array2 (A2:A2002) then sums the adjacent cells corresponding with Array's
1 & 2.

It almost looks as though it is summing everything up.

"Dave Peterson" wrote:

Why do you think your formula didn't work?

hellZg8 wrote:

This is a formula that I have now

=sumproduct((B2:B2002)="Machine")*(Year(A2:A2002)= 2006)
*(Month(A2:A2002)=1)*J2:J2002)

this works great (thanks to every one on this forum)

any ways I would like to add another condition in there.I tried the
following but
holy what a number did I get

=sumproduct((B2:B2002="Machine")*(C2:C2002="Repair s")*(Year(A2:A2002)=2006)*(Month(A2:A2002)=1)*J2:J 2002)

any help in the right direction will be greatly apprec.

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
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
sumproduct with 4 conditions EXCELably Challenged[_2_] Excel Worksheet Functions 1 March 19th 10 10:46 PM
Sumproduct with conditions EZ[_2_] Excel Worksheet Functions 0 December 10th 09 03:52 PM
SUMPRODUCT with conditions sahafi Excel Worksheet Functions 3 November 30th 06 10:32 PM
Conditions in sumproduct Antonio Excel Worksheet Functions 3 October 26th 06 03:18 AM
sumproduct three conditions Scire Excel Worksheet Functions 3 May 9th 06 06:22 PM


All times are GMT +1. The time now is 11:06 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"