Solved

Excel counting month difference

Posted on 2012-03-23
3
185 Views
Last Modified: 2012-03-24
Hey experts,

I have a Excel like:

join date      Jan 2009  Feb 2009 ........Mar 2012
2008/1/5          1               1                           1
2010/4/10                                                      1

formula inside =if(or(month(a2)<=month(b2), year(a2)<year(b2)),1,"")

that is, if the column heading date is larger than join date, 1 will be shown. and it works well

now I would like in another worksheet in same setting to set if the column heading date > join date for 6 months, 1 will be shown, else is ""

I try many times but fail........help...................
0
Comment
Question by:hkgal
3 Comments
 
LVL 12

Expert Comment

by:kgerb
ID: 37758200
How about this?  My join date starts in A2 and my column headings start in B1.

=IF(SUMPRODUCT(--(OFFSET(I1,0,-6,1,6)>$A$2))=6,1,"")

Kyle
0
 
LVL 80

Accepted Solution

by:
byundt earned 500 total points
ID: 37759647
You might try a formula like:
=IF((MONTH(B$1)+12*YEAR(B$1) - MONTH($A3)-12*YEAR($A3))>5,1,"")

This formula counts partial months as full months. For example, if hire date is December 28, 2011, then there will be two months of service in January 2012.

If instead you want to consider partial months as not the same as full months, then try using a DATEDIF formula like:
=IF($A2>B$1,"",IF(DATEDIF($A2,B$1,"m")>=6,1,""))

The sample workbook shows results for the case of row 1 being month beginning dates and also month ending dates.
Month-differenceQ27646260.xlsx
0
 

Author Closing Comment

by:hkgal
ID: 37760332
very good!
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now