If criteria is between 2 cells or matches either bring back data

Jaffabfc

Board Regular
Joined
Jul 5, 2013
Messages
196
Office Version
  1. 365
Platform
  1. Windows
HI,

The title probably isnt the best but basically i have a lot data on 2 seperate sheets.
1 sheet is showing in Column B an item code and in E a price F a start date G an end date
2nd sheet is showing Column A an item code and B a date.

So basically in column C in 2nd sheet i am wanting a formula to see if cell A matches column B in the 1st sheet and column B in sheet1 matches or is inbetween Coulnd F and G in sheet1 then bring back the price in sheet1.

Hope ive explained it well enough.
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
i think this is what you are after
=IFERROR(LOOKUP(1E+307,1/((Sheet1!A2=Sheet2!B:B)*(Sheet1!B2>=Sheet2!F:F)*(Sheet1!B2<=Sheet2!G:G))*Sheet2!E:E),0)

rather than use full column references , you maybe better off using a range


Book3
ABC
1
2a5/12/23500
Sheet1
Cell Formulas
RangeFormula
C2C2=IFERROR(LOOKUP(1E+307,1/((Sheet1!A2=Sheet2!B:B)*(Sheet1!B2>=Sheet2!F:F)*(Sheet1!B2<=Sheet2!G:G))*Sheet2!E:E),0)


Book3
BCDEFGH
1item
2a1001/1/231/31/23
3b2002/1/232/28/23
4a3003/1/233/31/23
5b4004/1/234/30/23
6a5005/1/235/31/23
7b6006/1/236/30/23
Sheet2
Cell Formulas
RangeFormula
G2:G7G2=EOMONTH(F2,0)


i only leave the file on dropbox for a few days
 
Upvote 0
Thanks for this.

I think its worked, had to change a few cells with me moving data around but once its calculated i will let you know.

Over 200,000 lines of data one sheet and over 400,000 on another.

thanks
 
Upvote 0

Forum statistics

Threads
1,213,531
Messages
6,114,167
Members
448,554
Latest member
Gleisner2

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