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






4/17/2018
5/29/2018ANTHONY C755167213600251672-1360-02ACYCLOVIR 5% OINTMENT 30 GM 10
5/30/20186/18/2018ANTHONY C755167213600251672-1360-02ACYCLOVIR 5% OINTMENT 30 GM 15
6/19/20187/23/2018ANTHONY C755167213600251672-1360-02ACYCLOVIR 5% OINTMENT 30 GM 20








<colgroup><col><col><col><col><col></colgroup><tbody>
</tbody>





















<colgroup><col><col><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
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,215,343
Messages
6,124,398
Members
449,155
Latest member
ravioli44

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