Formula Question

  • Thread starter Thread starter Thomas
  • Start date Start date
T

Thomas

I am trying to get a foluma that must look at a date field, determine if it
is this month/year, grab a value from a column, if it is a previous
month/year, grab a value from a different column, and if it is a future
month/year, grab zero.

I have some experience with multiple IF statements, but never one that
needed to act on a month/year. I have a sample if you want it, just send me
your email address.

Does anyone know how to write this type of formula?

Thank You

Thomas
 
hi,

on the monthy/year column use =if(month(a2)=12,b2,0)
on the prev. month/year dolumn use =if(month(a2)=11,b2,0)

hth
--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"Thomas" escreveu:
 
For date in A1, 'current' data in B1, 'previous' data in C1:
=IF(TEXT(A1,"yyyymm")=TEXT(TODAY(),"yyyymm"),B1,IF(TEXT(A1,"yyyymm")<TEXT(TODAY(),"yyyymm"),C1,0))
 
Try this:
=IF(AND(YEAR(A5)=YEAR(TODAY()),MONTH(A5)=MONTH(TODAY())),$C$5,IF(OR(YEAR(A5)<YEAR(TODAY()),AND(YEAR(A5)=YEAR(TODAY()),MONTH(A5)<MONTH(TODAY()))),$D$5,0))

Adjust cell references as required!

Regards,
Stefi

„Thomas†ezt írta:
 
Back
Top