Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default Month Deduct Formula needed

Hi all, I am trying to create month deduct formula below but not
having any success. In below data I got current date in cell A1 and
various dates in column D and then in column E in cell E1 I have
formula "=Month($A$1)-Month(D1)" which then continue to down. As you
can see in below data in cell E1 i am getting result which is "-5" as
it should be "7" because if you count months from date "19/06/2009" to
"01/11/2008" they are "7". I am trying to get postive figure in
column E and as you can see there are few results in negative figures
and also incorrect.

A D E -----col
19/06/2009 01/11/2008 -5
12/12/2008 -6
15/03/2009 3
16/10/2009 -4

The result should come something like below

A D E----col
19/06/2009 01/11/2008 7
12/12/2008 6
15/03/2009 3
16/10/2009 4

I need this formula also for conditional formatting as I am tring to
hilight rows in which dates are six months old from current date.
Please can any friend help me.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Month Deduct Formula needed

K wrote:
Hi all, I am trying to create month deduct formula below but not
having any success. In below data I got current date in cell A1 and
various dates in column D and then in column E in cell E1 I have
formula "=Month($A$1)-Month(D1)" which then continue to down. As you
can see in below data in cell E1 i am getting result which is "-5" as
it should be "7" because if you count months from date "19/06/2009" to
"01/11/2008" they are "7". I am trying to get postive figure in
column E and as you can see there are few results in negative figures
and also incorrect.

A D E -----col
19/06/2009 01/11/2008 -5
12/12/2008 -6
15/03/2009 3
16/10/2009 -4

The result should come something like below

A D E----col
19/06/2009 01/11/2008 7
12/12/2008 6
15/03/2009 3
16/10/2009 4

I need this formula also for conditional formatting as I am tring to
hilight rows in which dates are six months old from current date.
Please can any friend help me.


I solved your problem:

Formula: '=(JAAR($A$1)*12+MAAND($A$1))-(JAAR(D1)*12+MAAND(D1))
You can use this formula in the conditional format
k.r.
Piet Bom


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200906/1

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Month Deduct Formula needed

pietbom wrote:
Hi all, I am trying to create month deduct formula below but not
having any success. In below data I got current date in cell A1 and

[quoted text clipped - 23 lines]
hilight rows in which dates are six months old from current date.
Please can any friend help me.


I solved your problem:

Formula: '=(JAAR($A$1)*12+MAAND($A$1))-(JAAR(D1)*12+MAAND(D1))
You can use this formula in the conditional format
k.r.
Piet Bom

in english: JAAR = YEAR, MAAND=MONTH

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200906/1

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default Month Deduct Formula needed

thanks for replying piethbom. What is "JAAR" and "MAAND" as i am using
excel 2007 and i cant find these formulas. Can you please help

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 82
Default Month Deduct Formula needed

You could try something like this but it does give slightly different
results than you expect.

=IF($A$1B1,DATEDIF(B1,$A$1,"m"),DATEDIF($A$1,B1," m"))

On Jun 20, 7:27*am, K wrote:
thanks for replying piethbom. What is "JAAR" and "MAAND" as i am using
excel 2007 and i cant find these formulas. *Can you please help


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 TO DEDUCT LUNCH AND TEA TIMES DJRHUTCH Excel Discussion (Misc queries) 2 November 23rd 09 10:43 AM
formula for work rosters to deduct for different breaks vefl Excel Worksheet Functions 3 July 20th 09 04:56 AM
annual budget - by month help needed David Excel Worksheet Functions 4 December 12th 08 07:56 PM
How to summarize data and deduct on second sheet? (Formula) joromajr Excel Discussion (Misc queries) 2 July 20th 08 03:57 PM
Formula to deduct unpaid breaks in time sheet Rick Excel Discussion (Misc queries) 3 August 26th 05 11:53 PM


All times are GMT +1. The time now is 12:28 AM.

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"