Need help with formula... please help!

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Domski

Well-known Member
Joined
Jan 18, 2005
Messages
7,292
Try:

=SUMPRODUCT((INDIRECT("Sheet1!A"&B3&":A"&B4)>B1)*(INDIRECT("Sheet1!A"&B3&":A"&B4)< B2)*(INDIRECT("Sheet1!B"&B3&":B"&B4)))<?XML:NAMESPACE PREFIX = B2)*(INDIRECT("Sheet1!B"&B3&" /><B2)*(INDIRECT("Sheet1!B"&B3&":B"&B4)))< p>

Dom
</B2)*(INDIRECT("Sheet1!B"&B3&":B"&B4)))<>
 
Upvote 0

schielrn

Well-known Member
Joined
Apr 4, 2007
Messages
6,941
Maybe try:

=SUMPRODUCT(--(Sheet1!A2:A13 >= B1),--(Sheet1!A2:A13 <= B2),--(ROW(Sheet1!A2:A13) >= B3),--(ROW(Sheet1!A2:A13) <= B4),Sheet1!B2:B13)

I believe you are wanting < = and > = and not just < and >, at least for the row part.

Hope that helps.
 
Last edited:
Upvote 0

danmen

Board Regular
Joined
Jan 15, 2009
Messages
217
Re: Need help with macro - plz read second question inside!! thx. =))

thx. guys, I tried the first formula and it worked great so i didn't bother with the second one =))

SECOND QUESTION!!

I also have another question having to do with macros: I have a workbook with many sheets but I want limit which macros can be launched from the active sheet.... can this be done or does the alt+key always launch the macro regardless which sheet I'm in?
 
Upvote 0

schielrn

Well-known Member
Joined
Apr 4, 2007
Messages
6,941
Re: Need help with macro - plz read second question inside!! thx. =))

The Alt+F8 will always let you see all the macros within the workbook unless they are marked as private.

You could put an if statement in your macro code, that ended the amcro if it wasn't the correct sheet. Maybe something like:

Code:
if activesheet.name = "Sheet1" or activesheet.name = "Sheet2" then end

or if you want to include sheets it could be:

Code:
if activesheet.name <> "Sheet1" or activesheet.name <> "Sheet2" then end
Hope that helps.
 
Upvote 0

Forum statistics

Threads
1,191,690
Messages
5,988,107
Members
440,126
Latest member
duque00

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top