#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 107
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,047
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 364
Default 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



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,646
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
formula question Scott R Excel Worksheet Functions 2 October 2nd 07 07:03 AM
formula question Robert F Excel Discussion (Misc queries) 2 January 26th 07 07:48 PM
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
formula question B.B Excel Discussion (Misc queries) 2 August 29th 05 02:51 AM
formula Question danlinksman Excel Discussion (Misc queries) 3 January 25th 05 02:07 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"