Look Up Value with 2 Criteria and an IF Statement

drummerboy1023

New Member
Joined
Mar 24, 2009
Messages
6
May be a simple answer that I may be making more complex... I am trying to lookup a value in one tab and return it in another against multiple criteria...

the first tab looks like..

<table x:str="" style="border-collapse: collapse; width: 226pt;" width="301" border="0" cellpadding="0" cellspacing="0"><col style="width: 48pt;" span="2" width="64"> <col style="width: 63pt;" width="84"> <col style="width: 67pt;" width="89"> <tbody><tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; width: 48pt;" width="64" height="17">
</td> <td class="xl25" style="width: 48pt;" width="64">Date</td> <td class="xl25" style="width: 63pt;" width="84">End of Month</td> <td class="xl25" style="width: 67pt;" width="89">Start of Month</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt;" height="17">
</td> <td class="xl26" x:num="39896" x:fmla="=TODAY()">3/24/2009</td> <td class="xl26" x:num="39903" x:fmla="=EOMONTH(B2,0)">3/31/2009</td> <td class="xl24" style="width: 67pt;" x:num="39873" x:fmla="=DATE(YEAR(TODAY()),MONTH(TODAY()),1)" width="89">3/1/09</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt;" height="17">
Store
</td> <td class="xl25">Location</td> <td class="xl25">Packages</td> <td class="xl25">Rate</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt;" x:num="" height="17">1</td> <td class="xl25">NE</td> <td class="xl25">12
</td> <td class="xl25" x:num="">10</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt;" x:num="" height="17">2</td> <td class="xl25">SW</td> <td class="xl25">
</td> <td class="xl25" x:num="">13</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt;" x:num="" height="17">3</td> <td class="xl25">N</td> <td class="xl25">
</td> <td class="xl25" x:num="">14</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt;" x:num="" height="17">4</td> <td class="xl25">S</td> <td class="xl25">
</td> <td class="xl25" x:num="">8</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt;" x:num="" height="17">5</td> <td class="xl25">E</td> <td class="xl25">
</td> <td class="xl25" x:num="">6</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt;" x:num="" height="17">6</td> <td class="xl25">W</td> <td class="xl25">
</td> <td class="xl25" x:num="">10</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt;" x:num="" height="17">7</td> <td class="xl25">N</td> <td class="xl25">
</td> <td class="xl25" x:num="">5</td> </tr> </tbody></table>
The second tab looks like...

<table x:str="" style="border-collapse: collapse;" width="493" border="0" cellpadding="0" cellspacing="0" height="187"><col style="width: 48pt;" span="2" width="64"> <col style="width: 63pt;" width="84"> <col style="width: 67pt;" width="89"> <col style="width: 48pt;" span="3" width="64"> <tbody><tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt; width: 48pt;" width="64" height="17">
</td> <td colspan="2" class="xl26" style="border-right: 0.5pt solid black; width: 111pt;" x:num="39858" width="148"> 2/14/2009</td> <td colspan="2" class="xl26" style="border-left: medium none; border-right: 0.5pt solid black; width: 115pt;" x:num="39888" width="153"> 3/16/2009</td> <td colspan="2" class="xl26" style="border-left: medium none; border-right: 0.5pt solid black; width: 96pt;" x:num="39918" width="128"> 4/15/2009</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl31" style="height: 12.75pt;" height="17">
</td> <td class="xl36" style="border-top: medium none; border-left: medium none;">Packages</td> <td class="xl36" style="border-top: medium none; border-left: medium none;">Cartons</td> <td class="xl36" style="border-top: medium none; border-left: medium none;">Packages</td> <td class="xl36" style="border-top: medium none; border-left: medium none;">Cartons</td> <td class="xl37" style="border-top: medium none;">Packages</td> <td class="xl36" style="border-top: medium none;">Cartons</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl30" style="height: 12.75pt;" height="17">Store</td> <td class="xl29">
</td> <td class="xl35" style="border-left: medium none;">
</td> <td class="xl35" style="border-left: medium none;">
</td> <td class="xl35" style="border-left: medium none;">
</td> <td class="xl25">
</td> <td class="xl34">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl30" style="height: 12.75pt;" x:num="" height="17">1</td> <td class="xl30" x:num="">10</td> <td class="xl34" style="border-left: medium none;" x:num="" x:fmla="=B4*2">20</td> <td class="xl34" style="border-left: medium none;" x:num="">12</td> <td class="xl34" style="border-left: medium none;" x:num="" x:fmla="=D4*2">24</td> <td class="xl24" x:num="">15</td> <td class="xl34" x:num="" x:fmla="=F4*2">30</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl30" style="height: 12.75pt;" x:num="" height="17">2</td> <td class="xl30" x:num="">5</td> <td class="xl34" style="border-left: medium none;" x:num="" x:fmla="=B5*2">10</td> <td class="xl34" style="border-left: medium none;" x:num="">15</td> <td class="xl34" style="border-left: medium none;" x:num="" x:fmla="=D5*2">30</td> <td class="xl24" x:num="">12</td> <td class="xl34" x:num="" x:fmla="=F5*2">24</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl30" style="height: 12.75pt;" x:num="" height="17">3</td> <td class="xl30" x:num="">8</td> <td class="xl34" style="border-left: medium none;" x:num="" x:fmla="=B6*2">16</td> <td class="xl34" style="border-left: medium none;" x:num="">4</td> <td class="xl34" style="border-left: medium none;" x:num="" x:fmla="=D6*2">8</td> <td class="xl24" x:num="">14</td> <td class="xl34" x:num="" x:fmla="=F6*2">28</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl30" style="height: 12.75pt;" x:num="" height="17">4</td> <td class="xl30" x:num="">4</td> <td class="xl34" style="border-left: medium none;" x:num="" x:fmla="=B7*2">8</td> <td class="xl34" style="border-left: medium none;" x:num="">8</td> <td class="xl34" style="border-left: medium none;" x:num="" x:fmla="=D7*2">16</td> <td class="xl24" x:num="">6</td> <td class="xl34" x:num="" x:fmla="=F7*2">12</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl30" style="height: 12.75pt;" x:num="" height="17">5</td> <td class="xl30" x:num="">6</td> <td class="xl34" style="border-left: medium none;" x:num="" x:fmla="=B8*2">12</td> <td class="xl34" style="border-left: medium none;" x:num="">6</td> <td class="xl34" style="border-left: medium none;" x:num="" x:fmla="=D8*2">12</td> <td class="xl24" x:num="">8</td> <td class="xl34" x:num="" x:fmla="=F8*2">16</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl30" style="height: 12.75pt;" x:num="" height="17">6</td> <td class="xl30" x:num="">3</td> <td class="xl34" style="border-left: medium none;" x:num="" x:fmla="=B9*2">6</td> <td class="xl34" style="border-left: medium none;" x:num="">10</td> <td class="xl34" style="border-left: medium none;" x:num="" x:fmla="=D9*2">20</td> <td class="xl24" x:num="">13</td> <td class="xl34" x:num="" x:fmla="=F9*2">26</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl31" style="height: 12.75pt;" x:num="" height="17">7</td> <td class="xl32" style="border-left: medium none;" x:num="">4</td> <td class="xl32" style="border-left: medium none;" x:num="" x:fmla="=B10*2">8</td> <td class="xl32" style="border-left: medium none;" x:num="">6</td> <td class="xl32" style="border-left: medium none;" x:num="" x:fmla="=D10*2">12</td> <td class="xl33" x:num="">10</td> <td class="xl32" x:num="" x:fmla="=F10*2">20</td> </tr> </tbody></table>
Now what I am trying to do is find the the column (3/16/2009 - this cell is merged between two columns) in the second range that is within the End of Month (3/31/2009) and Start of Month Range (3/1/2009). I then need for it to return the # of packages for the corresponding store in the packages column in the first tab.. (i.e. 12 for Store 1.)

I have been trying to nest hlookups, vlookups, index, and match formulas in various ways but always hit a roadblock. The reason being is because every time I open the file the Date will change as it is a Today() function and the End of Month and Start of Month will change accordingly.

Thanks for the help!... starting to think this may not be possible....
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
There are a few ways to do this... one would be to use Sumproduct

If we assume source data of:

Excel Workbook
ABCDEFG
114/02/200916/03/200915/04/2009
2PackagesCartonsPackagesCartonsPackagesCartons
3Store
41102012241530
5251015301224
63816481428
7448816612
85612612816
963610201326
107486121020
Sheet2
<span style="font-family:Arial; font-size:9pt; font-weight:bold;background-color:#ffffff; color:#000000; ">Excel tables to the web >> </span>

We can have results of:

Excel Workbook
ABCD
1DateEnd of MonthStart of Month
224/03/200931/03/200901/03/2009
3StoreLocationPackagesRate
41NE1210
52SW1513
63N414
74S88
85E66
96W1010
107N65
Sheet1
 
Upvote 0
Thanks for the quick response... I entered the formula exactly as how you typed it and yet got a 0 value...

suggestions on where I may have went wrong or on another way I could attack the problem.

Thanks again!
 
Upvote 0

Forum statistics

Threads
1,214,958
Messages
6,122,475
Members
449,087
Latest member
RExcelSearch

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