IF one date falls on/between 2 others AND a cell matches, then return result

miken54

New Member
Joined
Sep 18, 2017
Messages
20
Hi Experts, I would really appreciate some guidance as I cant quite figure out what formula to use. If this was already answered previously, I cant seem to find. I Already spent hours on forums and youtube videos. Perhaps I am wording my question wrong?


I have thousands of rows of ITEM #'s that my company buys each month from a certain vendor. At any point in a given month, there can be rebates that we are entitled to claim. My vendor lists each item#, and if we purchase that item on or between the date range they list, we earn a certain rebate.


So in the example below, model 5555 has three different rebates happening in the month of January, varying in amounts that are due to my company. In the last line of my Vendors Report, you will see that between 1/21/17-1/23/17; there are no rebates.


My companies report below lists each model we purchased and when we purchased it.


I'm losing my mind trying to determine what formula to use so into "H" so that if "F" shows up anywhere in "A"), and "G" falls between "B"-"C", the correct value will be returned.


Would it be a combination of V-Lookup/ if/and?

0



​I hope I worded this correctly. Any suggestions would be greatly appreciated. ​
 
Re: Formula Help Request. IF one date falls on/between 2 others AND a cell matches, then return result

try
=IFERROR(LOOKUP(1E+307,1/((F2=A:A)*(G2>=B:B)*(G2<=C:C))*D:D),IFERROR(LOOKUP(1E+307,1/((F2=A:A)*(H2>=B:B)*(H2<=C:C))*D:D),0))

Thank you so much!!!!!
 
Upvote 0

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Re: Formula Help Request. IF one date falls on/between 2 others AND a cell matches, then return result

try
=IFERROR(LOOKUP(1E+307,1/((F2=A:A)*(G2>=B:B)*(G2<=C:C))*D:D),IFERROR(LOOKUP(1E+307,1/((F2=A:A)*(H2>=B:B)*(H2<=C:C))*D:D),0))

Hey, I feel like its super close, just missing something small (most likely because of the way I tried to explain it). In cell i4, when I run this formula, I am getting the returned value of $106, however it should be $0. G4 (the "ordered date of
10/23/2017) should not qualify for a rebate because it was ordered on a date that the promotional period (B) was not offering any rebates.

In order to qualify for a rebate, both G and H must fall on or between B and C.

ABCDEFGHI
ITEMSTART DATEEND DATEREBATEITEMORDEREDREC'DREWARD
19/27/201710/18/20176519/28/201710/1/201765
111/1/201711/29/2017106110/23/201711/1/2017106

<tbody>
</tbody>


You have been so helpful so far, I just spent the last 2 hours trying to do this on my own but I cant figure it out. If you wouldnt mind, it would be such a huge help. Thanks again
 
Upvote 0
Re: Formula Help Request. IF one date falls on/between 2 others AND a cell matches, then return result

=IFERROR(LOOKUP(1E+307,1/((F2=A:A)*(G2>=B:B)*(H2>=B:B)*(H2<=C:C)*(G2<=C:C))*D:D),0)

so this is using
(G2>=B:B)*(H2>=B:B)*(H2<=C:C)*(G2<=C:C)

So both G and H must be between B and C
 
Upvote 0
Re: Formula Help Request. IF one date falls on/between 2 others AND a cell matches, then return result

=IFERROR(LOOKUP(1E+307,1/((F2=A:A)*(G2>=B:B)*(H2>=B:B)*(H2<=C:C)*(G2<=C:C))*D:D),0)

so this is using
(G2>=B:B)*(H2>=B:B)*(H2<=C:C)*(G2<=C:C)

So both G and H must be between B and C


OK, you are AMAZING!!!! This worked perfectly and I am able to go back and confirm every old rebate! Thank you so much. Happy Holidays to you and your family!!!!
 
Upvote 0
Re: Formula Help Request. IF one date falls on/between 2 others AND a cell matches, then return result

you are welcome
have a great holiday and new year
 
Upvote 0

Forum statistics

Threads
1,215,873
Messages
6,127,459
Members
449,383
Latest member
DonnaRisso

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top