A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Sumproduct range changing with deletions



 
 
Thread Tools Display Modes
  #1  
Old August 4th, 2008, 06:26 PM posted to microsoft.public.excel.worksheet.functions
Steve
external usenet poster
 
Posts: 2,662
Default Sumproduct range changing with deletions

I have this formula in one of the tabs in my workbook:

=SUMPRODUCT((Sun!$G$3:$G$200="Time missing for
sunday")*(Sun!$J$3:$J$200="Swingshift"))

I understand sumproduct cannot do whole ranges via $G:$G.

If I delete rows 101-200 on the Sun tab, this formula on the main is changed
as below:

=SUMPRODUCT((Sun!$G$3:$G$100="Time missing for
sunday")*(Sun!$J$3:$J$100="Swingshift"))

the 200 s become 100 s.

Is there a way to around that, so that the :200s are not changed to :100s ?

Thanks,

Steve
  #2  
Old August 4th, 2008, 06:34 PM posted to microsoft.public.excel.worksheet.functions
Lars-Åke Aspelin[_2_]
external usenet poster
 
Posts: 722
Default Sumproduct range changing with deletions

On Mon, 4 Aug 2008 10:26:30 -0700, Steve
wrote:

I have this formula in one of the tabs in my workbook:

=SUMPRODUCT((Sun!$G$3:$G$200="Time missing for
sunday")*(Sun!$J$3:$J$200="Swingshift"))

I understand sumproduct cannot do whole ranges via $G:$G.

If I delete rows 101-200 on the Sun tab, this formula on the main is changed
as below:

=SUMPRODUCT((Sun!$G$3:$G$100="Time missing for
sunday")*(Sun!$J$3:$J$100="Swingshift"))

the 200 s become 100 s.

Is there a way to around that, so that the :200s are not changed to :100s ?

Thanks,

Steve



You can use the INDIRECT function for this.

=SUMPRODUCT((INDIRECT("Sun!$G$3:$G$100")="Time missing for
sunday")*(INDIRECT("Sun!$J$3:$J$100")="Swingshift" ))

Hope this helps / Lars-Åke
  #3  
Old August 4th, 2008, 06:36 PM posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom[_2_]
external usenet poster
 
Posts: 963
Default Sumproduct range changing with deletions

Try


=SUMPRODUCT((INDIRECT("Sun!$G$1:$G$200")="Time missing for
sunday")*(INDIRECT("Sun!$J$1:$J$200")="Swingshift" ))


the only drawback is that the INDIRECT function is volatile and will
recalculate whenever the worksheet recalculates meaning that if you open the
workbook and just look at it and then close the workbook it will still ask
you if you want to save the workbook and it means if you have lots of
formulas it has the potential to slow down the workbook.

--


Regards,


Peo Sjoblom

"Steve" wrote in message
...
I have this formula in one of the tabs in my workbook:

=SUMPRODUCT((Sun!$G$3:$G$200="Time missing for
sunday")*(Sun!$J$3:$J$200="Swingshift"))

I understand sumproduct cannot do whole ranges via $G:$G.

If I delete rows 101-200 on the Sun tab, this formula on the main is
changed
as below:

=SUMPRODUCT((Sun!$G$3:$G$100="Time missing for
sunday")*(Sun!$J$3:$J$100="Swingshift"))

the 200 s become 100 s.

Is there a way to around that, so that the :200s are not changed to :100s
?

Thanks,

Steve



  #4  
Old August 4th, 2008, 07:24 PM posted to microsoft.public.excel.worksheet.functions
John C[_2_]
external usenet poster
 
Posts: 1,350
Default Sumproduct range changing with deletions

Assuming nothing else is in the columns, you could use the formula like this:
=SUMPRODUCT((Sun!$G$3:$G$65536="Time missing for
sunday")*(Sun!$J$3:$J$65536="Swingshift"))



--
John C


"Steve" wrote:

I have this formula in one of the tabs in my workbook:

=SUMPRODUCT((Sun!$G$3:$G$200="Time missing for
sunday")*(Sun!$J$3:$J$200="Swingshift"))

I understand sumproduct cannot do whole ranges via $G:$G.

If I delete rows 101-200 on the Sun tab, this formula on the main is changed
as below:

=SUMPRODUCT((Sun!$G$3:$G$100="Time missing for
sunday")*(Sun!$J$3:$J$100="Swingshift"))

the 200 s become 100 s.

Is there a way to around that, so that the :200s are not changed to :100s ?

Thanks,

Steve

  #5  
Old August 4th, 2008, 07:49 PM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default Sumproduct range changing with deletions

Here's another one.

Non-volatile and more efficient than using almost the entire column as a
reference:

=SUMPRODUCT(--(Sun!$G$3:INDEX(Sun!G$3:G$65536,200)="Time"),--(Sun!$J$3:INDEX(Sun!J$3:$J$65536,200)="Swingshift" ))

--
Biff
Microsoft Excel MVP


"Steve" wrote in message
...
I have this formula in one of the tabs in my workbook:

=SUMPRODUCT((Sun!$G$3:$G$200="Time missing for
sunday")*(Sun!$J$3:$J$200="Swingshift"))

I understand sumproduct cannot do whole ranges via $G:$G.

If I delete rows 101-200 on the Sun tab, this formula on the main is
changed
as below:

=SUMPRODUCT((Sun!$G$3:$G$100="Time missing for
sunday")*(Sun!$J$3:$J$100="Swingshift"))

the 200 s become 100 s.

Is there a way to around that, so that the :200s are not changed to :100s
?

Thanks,

Steve



  #6  
Old August 4th, 2008, 09:03 PM posted to microsoft.public.excel.worksheet.functions
Spiky
external usenet poster
 
Posts: 619
Default Sumproduct range changing with deletions

Theoretically, you could also just hit the Delete key (which means the
Clear command) instead of the Delete command. If the formatting can
stay the same.
  #7  
Old August 4th, 2008, 10:24 PM posted to microsoft.public.excel.worksheet.functions
Steve
external usenet poster
 
Posts: 2,662
Default Sumproduct range changing with deletions

Thanks guys. Already I'm showing some results with some of the solutions. I'm
currently having a bit of a problem with the indirects, but it's probably a
parentheses typo on my part. I'll get it worked out.

Thanks again,

Steve

"Steve" wrote:

I have this formula in one of the tabs in my workbook:

=SUMPRODUCT((Sun!$G$3:$G$200="Time missing for
sunday")*(Sun!$J$3:$J$200="Swingshift"))

I understand sumproduct cannot do whole ranges via $G:$G.

If I delete rows 101-200 on the Sun tab, this formula on the main is changed
as below:

=SUMPRODUCT((Sun!$G$3:$G$100="Time missing for
sunday")*(Sun!$J$3:$J$100="Swingshift"))

the 200 s become 100 s.

Is there a way to around that, so that the :200s are not changed to :100s ?

Thanks,

Steve

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:42 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.