Solved

Excel counting month difference

Posted on 2012-03-23
3
189 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 81

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
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 viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

813 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

15 Experts available now in Live!

Get 1:1 Help Now