ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Formula Question (https://www.excelbanter.com/excel-worksheet-functions/170427-formula-question.html)

Thomas

Formula Question
 
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

Marcelo

Formula Question
 
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:

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


Stephen[_2_]

Formula Question
 
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))

"Thomas" wrote in message
...
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




Stefi

Formula Question
 
Try this:
=IF(AND(YEAR(A5)=YEAR(TODAY()),MONTH(A5)=MONTH(TOD AY())),$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:

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



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com