Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 50
Default SumProduct too slow

I have a worksheet filled with formulas similiar to this one:

=IF(SUMPRODUCT((ProductionDate=G$3)*(LineID=$D5)*( QtyProduced))=0,1E-50,(SUMPRODUCT((ProductionDate=G$3)*(LineID=$D5)*( QtyProduced))))

Where ProductionDate, LineID, and QtyProduced are neamed ranges on a
different tab of the same workbook.

If is very very slow to calculate.

Does anyone have a suggestion on how to speed things up?

Thanks,
Diane
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default SumProduct too slow

If those ranges are larger than what they need to be, it'll take longer.

But is there a real reason why you're replacing 0 with that very small number.
If your =sumproduct() doesn't equal 0, then your formula does the calculation
twice.

If you really have to have that 1e-50 shown, then maybe you can use two
cells--one for the =sumproduct() formula and one for the check if 0

=if(a2=0,1e-50,a2)
(and hide that column (A in my example)

diaare wrote:

I have a worksheet filled with formulas similiar to this one:

=IF(SUMPRODUCT((ProductionDate=G$3)*(LineID=$D5)*( QtyProduced))=0,1E-50,(SUMPRODUCT((ProductionDate=G$3)*(LineID=$D5)*( QtyProduced))))

Where ProductionDate, LineID, and QtyProduced are neamed ranges on a
different tab of the same workbook.

If is very very slow to calculate.

Does anyone have a suggestion on how to speed things up?

Thanks,
Diane


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 50
Default SumProduct too slow

"Dave Peterson" wrote:

But is there a real reason why you're replacing 0 with that very small number.
If your =sumproduct() doesn't equal 0, then your formula does the calculation
twice.


Short answer: I inherited this spreadsheet and that is how it was set up.

Long Answer: I think it was so that we can distinguish between a day where
there was no production, and a day in the future that has just not had any
production yet.

So - in other formulas in the worksheet there are if statements that
resemble: if qty produced is 0 then.... These formulas would work on the
1e-50 cells (really no production) yet ignore the zeros (date in the future).

That said, is there a way to tell my sumprodoct formula to return a zero if
there is a zero in the production range, but stay null if the production
range is blank for that specific day?
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default SumProduct too slow

Also, looking at the original formula (quickly) and seeing what it does
(make a 0 value into the near 0 value of 1E-50), it would seem you could
eliminate one of the SUMPRODUCT calculations by using a MIN function call
instead....

=MIN(1E-50,SUMPRODUCT((ProductionDate=G$3)*(LineID=$D5)*Qt yProduced))

Rick


"Dave Peterson" wrote in message
...
If those ranges are larger than what they need to be, it'll take longer.

But is there a real reason why you're replacing 0 with that very small
number.
If your =sumproduct() doesn't equal 0, then your formula does the
calculation
twice.

If you really have to have that 1e-50 shown, then maybe you can use two
cells--one for the =sumproduct() formula and one for the check if 0

=if(a2=0,1e-50,a2)
(and hide that column (A in my example)

diaare wrote:

I have a worksheet filled with formulas similiar to this one:

=IF(SUMPRODUCT((ProductionDate=G$3)*(LineID=$D5)*( QtyProduced))=0,1E-50,(SUMPRODUCT((ProductionDate=G$3)*(LineID=$D5)*( QtyProduced))))

Where ProductionDate, LineID, and QtyProduced are neamed ranges on a
different tab of the same workbook.

If is very very slow to calculate.

Does anyone have a suggestion on how to speed things up?

Thanks,
Diane


--

Dave Peterson


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,081
Default SumProduct too slow

by using a MIN function call
perhaps a MAX() would be better for the OP's purposes.

"Rick Rothstein (MVP - VB)" wrote:

Also, looking at the original formula (quickly) and seeing what it does
(make a 0 value into the near 0 value of 1E-50), it would seem you could
eliminate one of the SUMPRODUCT calculations by using a MIN function call
instead....

=MIN(1E-50,SUMPRODUCT((ProductionDate=G$3)*(LineID=$D5)*Qt yProduced))

Rick


"Dave Peterson" wrote in message
...
If those ranges are larger than what they need to be, it'll take longer.

But is there a real reason why you're replacing 0 with that very small
number.
If your =sumproduct() doesn't equal 0, then your formula does the
calculation
twice.

If you really have to have that 1e-50 shown, then maybe you can use two
cells--one for the =sumproduct() formula and one for the check if 0

=if(a2=0,1e-50,a2)
(and hide that column (A in my example)

diaare wrote:

I have a worksheet filled with formulas similiar to this one:

=IF(SUMPRODUCT((ProductionDate=G$3)*(LineID=$D5)*( QtyProduced))=0,1E-50,(SUMPRODUCT((ProductionDate=G$3)*(LineID=$D5)*( QtyProduced))))

Where ProductionDate, LineID, and QtyProduced are neamed ranges on a
different tab of the same workbook.

If is very very slow to calculate.

Does anyone have a suggestion on how to speed things up?

Thanks,
Diane


--

Dave Peterson





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default SumProduct too slow

LOL ... yeah, MAX would be better, wouldn't it.<g

Thanks for spotting that.

Rick


"Duke Carey" wrote in message
...
by using a MIN function call

perhaps a MAX() would be better for the OP's purposes.

"Rick Rothstein (MVP - VB)" wrote:

Also, looking at the original formula (quickly) and seeing what it does
(make a 0 value into the near 0 value of 1E-50), it would seem you could
eliminate one of the SUMPRODUCT calculations by using a MIN function call
instead....

=MIN(1E-50,SUMPRODUCT((ProductionDate=G$3)*(LineID=$D5)*Qt yProduced))

Rick


"Dave Peterson" wrote in message
...
If those ranges are larger than what they need to be, it'll take
longer.

But is there a real reason why you're replacing 0 with that very small
number.
If your =sumproduct() doesn't equal 0, then your formula does the
calculation
twice.

If you really have to have that 1e-50 shown, then maybe you can use two
cells--one for the =sumproduct() formula and one for the check if 0

=if(a2=0,1e-50,a2)
(and hide that column (A in my example)

diaare wrote:

I have a worksheet filled with formulas similiar to this one:

=IF(SUMPRODUCT((ProductionDate=G$3)*(LineID=$D5)*( QtyProduced))=0,1E-50,(SUMPRODUCT((ProductionDate=G$3)*(LineID=$D5)*( QtyProduced))))

Where ProductionDate, LineID, and QtyProduced are neamed ranges on a
different tab of the same workbook.

If is very very slow to calculate.

Does anyone have a suggestion on how to speed things up?

Thanks,
Diane

--

Dave Peterson




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default SumProduct too slow

Sumproduct can be very slow if you have large ranges and/or many
conditions. SUMIF is a lot quicker, but can only use one criteria.
However, if you combine your two conditions into one helper column
like this:

=ProductionDate&LineID,

then you could use SUMIF(helper,G$3&$D5,QtyProduced) to replace your
SUMPRODUCT term, and this would be a lot faster.

Hope this helps.

Pete

On Oct 29, 6:07 pm, diaare wrote:
I have a worksheet filled with formulas similiar to this one:

=IF(SUMPRODUCT((ProductionDate=G$3)*(LineID=$D5)*( QtyProduced))=0,1E-50,(SU*MPRODUCT((ProductionDate=G$3)*(LineID=$D5)* (QtyProduced))))

Where ProductionDate, LineID, and QtyProduced are neamed ranges on a
different tab of the same workbook.

If is very very slow to calculate.

Does anyone have a suggestion on how to speed things up?

Thanks,
Diane



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
Slow Sumproduct wx4usa Excel Discussion (Misc queries) 1 August 26th 07 11:23 PM
SumProduct making things work slow Adam Graham Excel Worksheet Functions 7 February 4th 07 08:41 AM
Sumproduct Slow wx4usa New Users to Excel 4 January 27th 07 07:05 PM
Sumproduct formulas & slow response Darby Excel Worksheet Functions 1 November 21st 05 09:21 PM
sumproduct formula to slow Todd Excel Worksheet Functions 4 December 21st 04 11:25 PM


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