• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VLookup a value within a date range in a different date range

glenda75

New Member
Hi!


I have a worksheet in which I have to bring an amount from another table but there are multiple criterias that have to be met.


ie:


this is what I am looking for

[pre]
Code:
Contract id                 dates                     price?

12345          3/1/2009        3/31/2009
this is the data that I am looking for into:

Contract id                 dates                           price

12345                     12/1/2009 -1/2/2010        10.00

12345                    1/1/2009 - 5/31/2009          6.00
[/pre]
So the result that I should yield is the $6.00 because it is the same contract id and the march date falls within that range.


HELP!!! I can upload the file if needed...


thank you!!
 
Something like:

=SUMPRODUCT((IDRange=ID)*(StartDateRange<=StartDate)*(EndDateRange>=EndDate)*(PriceRange))

Replace each of those words with correct cell/range references.
 
Hi, glenda75!


Luke M's formula is "filtering" by these conditions:

- IDRange = ID

- StartDateRange <= StartDate

- EndDateRange >= EndDate


So regarding your first comment, dates in StartDateRange are considered only if less or equal to Start date (same applies to end dates if great or equal), and regarding your last question, all ids in IDRange equal to ID are considered too.


Hope it helps.


Regards!
 
Hello!


I'm sorry but we tried the formula and it didn't seem to work.


Can you please take a look at the link and see what is wrong with the formula?


https://skydrive.live.com/?cid=0F7F1A994B7EEA62&id=F7F1A994B7EEA62%21110


thank you sooo much....


Glenda
 
Hi, glenda75!

In E3 use this formula, following Luke M indications:

=SUMAPRODUCTO(($A$8:$A$9=$A$3)*($B$8:$B$9<=$C$3)*($C$8:$C$9>=$C$3)*($D$8:$D$9)) -----> in english: =SUMPRODUCT(($A$8:$A$9=$A$3)*($B$8:$B$9<=$C$3)*($C$8:$C$9>=$C$3)*($D$8:$D$9))

Regards!
 
Back
Top