Return a cell reference as a result of an IF formula

L

Larry G

I am using an IF logical. If the result is true, I would like to return the
SUM of a range or cells. Or at the very least return cell reference. eg
=IF(K3<=DATE(2010,1,31),AND(K3>=DATE(2010,1,1))) Since this is a true
statement, I would like it to return the SUM of A1:A10

Thank you.
 
D

Dave Peterson

=if(and(date(2010,1,1)<=k3,k3<=date(2010,1,31)),sum(a1:a10),"whateveryouwant")

Because you're using the complete month, you have other choices, too:

=if(text(k3,"yyyymm")="201001",sum(a1:a10),"not in Jan 2010")

=if(and(month(k3)=1,year(k3)=2010),sum(a1:a10"),"anything else?")
 

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