IF date statement

guaya81

New Member
Joined
May 9, 2018
Messages
25
Hello Experts

I will like to see if anyone can help me simplify a formula that I just manage to getter bigger and bigger and I know it may be an easier way

I have a file that we paid commissions and under the file there a date column so I create a formula to lookup that value and return the price,

=IF(AND(Query1[@[Invc Date]]>=Comm!A:A,Query1[@[Invc Date]]<=Comm!B:B),IFERROR(VLOOKUP(CONCATENATE(Query1[@Slsprs],Query1[@Item]),Comm!$C:$G,5,0),"0"),"0")


I manage to freeze the value and here is where I need the help as the comm changes I have to paste new value and freeze the new date and so on, but I will like to see it is the formula that will look the value for the right date column and the left date column and if is in between does dates then lookup the values under that criteria.

this is an example of 1 product with different prices and dates
Colum A Colum B Column C Column D Column E Column F

[TABLE="width: 831"]
<colgroup><col><col><col><col><col></colgroup><tbody>[TR]
[TD="align: right"]


[TABLE="width: 831"]
<colgroup><col><col><col><col><col></colgroup><tbody>[TR]
[TD="align: right"]

4/17/2018[/TD]
[TD="align: right"]5/29/2018[/TD]
[TD]ANTHONY C7551672136002[/TD]
[TD]51672-1360-02[/TD]
[TD]ACYCLOVIR 5% OINTMENT 30 GM 10[/TD]
[/TR]
[TR]
[TD="align: right"]5/30/2018[/TD]
[TD="align: right"]6/18/2018[/TD]
[TD]ANTHONY C7551672136002[/TD]
[TD]51672-1360-02[/TD]
[TD]ACYCLOVIR 5% OINTMENT 30 GM 15[/TD]
[/TR]
[TR]
[TD="align: right"]6/19/2018[/TD]
[TD="align: right"]7/23/2018[/TD]
[TD]ANTHONY C7551672136002[/TD]
[TD]51672-1360-02[/TD]
[TD]ACYCLOVIR 5% OINTMENT 30 GM 20







[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD="align: right"][/TD]
[TD][/TD]
[TD][/TD]
[TD]



















[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
It would help if you name the columns so we know what we're looking at

if you're just trying to find what the price is

With your data in A1:K3

A7 date youre looking for
A8 C7551672136002
A9 51672-1360-02
A10 ACYCLOVIR

in a blank cell

=LOOKUP(2,1/(A$1:A$3<=A7)/(B$1:B$3>=A7)/(D$1:D$3=A8)/(E$1:E$3=A9),(K$1:K$3))

will return the value of product for a given date.
Remove any of the conditions you don't think need to apply.

I've had to insert most of them as you didnt specify what the conditions were required.
 
Last edited:
Upvote 0
Special-K99

thanks for your help and I really don't understand that formula, but if you are willing to help I can share the file so you can take a look

thanks
 
Upvote 0
You can't post files to this forum but you can upload it to an online storage site and place a link to it here.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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