Solved

Excel counting month difference

Posted on 2012-03-23
3
193 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
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 the scrolling table in Microsoft Excel using the INDEX function.

735 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