# Complicated Match/Lookup in between dates formula?

#### DanteAmor

##### Well-known Member
Here is the actual data from my workbook. Note that this info is contained on different pages. In this case, could you write the formula trying to get the Related Weekly Spend number from Sheet2 into the column on Sheet1?

The rules are the same as that I need the Tracking Number to Match from Sheet1 to Sheet2, and then I need the Date in Sheet1 to fall between the Date of the Matching Tracking Number. If there is none, I need it to go to the date range before it.
To continue with the formula, it is important to answer the following:

It is always the previous date.
In an example.
If the date is 25may, the ranges are
a) 1apr - 20apr
b) 26may - 31may
So what is the corresponding range a) or b)?

The nearest date is 26may, but do you want the previous date?

---------------------------------------------

You could upload a copy of your file to a free site such www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. If the workbook contains confidential information, you could replace it with generic data.

### Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

#### jwillits

##### New Member
To continue with the formula, it is important to answer the following:

It is always the previous date.
In an example.
If the date is 25may, the ranges are
a) 1apr - 20apr
b) 26may - 31may
So what is the corresponding range a) or b)?

The nearest date is 26may, but do you want the previous date?

---------------------------------------------

You could upload a copy of your file to a free site such www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. If the workbook contains confidential information, you could replace it with generic data.

A would be correct, I need the nearest previous date, only if it is not between a set of dates.

#### DanteAmor

##### Well-known Member

You could upload a copy of your file to a free site such www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. If the workbook contains confidential information, you could replace it with generic data.

#### tico_ocit

##### New Member
"*" is a nested if.

if (condition, if (condition, true))
or
if (condition * condition, true)

"," or ";" It is the argument separator that you have configured by region.
So the "*" works as entering another IF in the 'True' section?

#### DanteAmor

##### Well-known Member
So the "*" works as entering another IF in the 'True' section?
it is right.
Boolean logic says:
* = and
+ = or

#### tico_ocit

##### New Member
it is right.
Boolean logic says:
* = and
+ = or
Nice! Didn't know! Always learning something! Thank you!

#### DanteAmor

##### Well-known Member
Nice! Didn't know! Always learning something! Thank you!
In excel you always learn something new.

#### Sam_D_Ben

##### Active Member
Been using Excel and Access for 13 years, and i am still a beginner