Solved

Returning A Value If Cell Date Is Between Two Dates

Posted on 2013-02-07
2
556 Views
Last Modified: 2013-02-07
i have a problem i want to calculate dearness allowance of our employees which is associated with dates,

we have a dearness rate of 0% from 01-01-2006 to 30-06-2006,
2% from 01-07-2006 to 31/12/2006,
4% from 01-01-2007 to 30/06/2007,
6% from 01-07-2007 to 31/12/2007,
9% from 01/01/2008 to 30/06/2008,
12% from 01/07/2008 to 31/12/2008,
16% from 01/01/2009 to 30/06/2009,
22% from 01/07/2009 to 30/06/2009

when we type date in a1, it will automatically write the associted dearness rate in b1.

Thanx.
0
Comment
Question by:edreamers
[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
2 Comments
 
LVL 23

Accepted Solution

by:
NBVC earned 500 total points
ID: 38865078
If you have the start dates say in X2:X9, and the end dates in Y2:Y9, along with corresponding rates in Z2:Z9,

Then try:

=SUMIFS($Z$2:$Z$9,$X$2:$X$9,"<="&A1,$Y$2:$Y$9,">="&A1)

adjust ranges to suit where you want the data to be.
0
 
LVL 26

Expert Comment

by:redmondb
ID: 38865145
Hi,  edreamers.

Please see attached. (I've assumed that your last date should be 31/12/2009).

The formula is...
=IF(OR(A1<G1,A1>=G9,NOT(ISNUMBER(A1))),"",INDEX($F$1:$F$9,MATCH(A1,G1:G9,1),0))

Let me know if you'd like a message (rather than blank) for invalid input.

Regards,
Brian.Rates.xls
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This article describes a serious pitfall that can happen when deleting shapes using VBA.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

738 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