Moving range?

W

wx4usa

I have Months in B1:M1.
Dollars in B2:M2

I need a formula to return the sum dollars of a range of consecutive
months that is variable such as.....start month is in cell a1 and end
month is in a2. a1=March a2=October

Thank you so much for your help!!
 
D

Don Guillett

Not much detail but something like for dates in col A 3=march

=sumproduct((month(a2:a22)=3)*(month(a2:a22)=10)*b2:b22)
 
D

David Biddulph

Are you sure? Wouldn't that always be zero? A cell in column A can't be 3
and 10 at the same time.
 
F

Fred Smith

If you truly have the words "March" and "October" in a1 and a2, you're not
going to get any formulas to work.

You need either dates or month numbers (not names). Dates work best because
you can format them to your liking (such as displaying only the month name).

When a1:a2 and b1:m1 have numbers (or dates) in them, use:
=sumproduct(--(b1:m1>=a1),--(b1:m1<=a2),--(b2:m2))

Regards,
Fred
 
E

excelent

=SUM(INDIRECT(ADDRESS(2,MATCH(A1,B1:M1,0)+1)&":"&ADDRESS(2,MATCH(A2,B1:M1,0)+1)))



"Fred Smith" skrev:
 
W

wx4usa

=SUM(INDIRECT(ADDRESS(2,MATCH(A1,B1:M1,0)+1)&":"&ADDRESS(2,MATCH(A2,B1:M1,0)+1)))

"Fred Smith" skrev:

How do I make the formula look for data on another sheet in the same
workbook? My a1 and b1 are on one sheet and the b1:m1 and data is on
another.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top