Hello, I need to figure out how to match three values on the "source info.xls" file attached to the "PFG FILE.xls" that is also attached. In column A in the "Source info.xls" file the formula will need to match the yellow column, then the green column, then the red column. Please keep in mind that the attached files are just a small subset of data. The "PFG File.XLS" is actually 150K rows long.
Thanks for your help!
Last edited by dcgrove; 01-28-2010 at 04:05 PM.
If you have the volume of data you say you have then you should really be looking at means to keep the linked formula as efficient as possible.
On that basis I would suggest you do the following
ThenCode:PFG File.xls P4: =$C4&"@"&$E4&"@"&$O4 copied down for all rows
NOTE: above formula assumes both files are open at the time of being added and that file is XL2007 (ie 150000 is a valid reference)Code:source info.xls A3: =ISNUMBER(MATCH($C3&"@"&$H3&"@"&$F3,'[PFG FILE .xls]Sheet1'!$P$4:$P$150000,0)) copied down
It would be even better if you could sort PFG File by C, E & O in that order of preference as you could then run a MATCH utilising Binary Search which would greatly reduce the amount of cells being processed.
That is the implication of your file but given there is only one store we can't be sure...
Last edited by DonkeyOte; 01-26-2010 at 01:38 PM. Reason: incorrect cell refs. in the MATCH - ie C3 etc not C4
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
DonKeyote, I can sort the PFG file. The data is originally in a text file that I import into the PFG Data file. I am not sure how to run the MATCH function with the binary search though. Can you explain?
Thanks!
If the data is sorted by C & E & O then in theory you can conduct a MATCH using the default match_type setting of 1 rather than the exact match setting of 0
When MATCH uses it's default setting of 1/TRUE it uses Binary Search and searches a much smaller subset of data making it much much quicker.... esp. on large data sets such as this.Code:A3: =INDEX('[PFG FILE .xls]Sheet1'!$P$4:$P$150000,MATCH($C3&"@"&$H3&"@"&$F3,'[PFG FILE .xls]Sheet1'!$P$4:$P$150000))=$C3&"@"&$H3&"@"&$F3 copied down
For a graphical representation of how Binary Search works see: http://www.mrexcel.com/forum/showpos...98&postcount=7
Of course it will not be conducting an exact match rather it will return the last value <= criteria value.
Given this fact we subsequently conduct an additional test to see if the value returned c/o of the binary search matches the criteria... this is our Boolean output.
Make sense ?
Last edited by DonkeyOte; 01-26-2010 at 02:27 PM. Reason: repetition in narrative
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
DonKeyote, thank you for the help. I have included the second set of formula you suggested but have run into an issue and cannot figure it out. Some of the cells are indicating "False" in the book1.xlsx file (an example is highlighted) but the data is actually included in the PFG FILES.xlsm. do you think you could take a look at it and see if you can tell why?
I had to upload the files somewhere else because it is too large.
PFG File.xlsm
Book1.xlsx
Thanks!
Donkeyote, thank you for your help on this. While reading through your suggested reading links in your sig, I figured out that a sumproduct could could do what required. I ended up using the formula below to return a 1 or 0 for in place of true/false. Without your original suggestions, I would have never thought to use the "&" to combine the three cells I was trying to match.
=SUMPRODUCT(--('[011910 Data File.xlsx]PFGTRANS011910'!$A$2:$A$229616=C4&H4&F4))
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks