May 17 2019 05:33 AM
Hello,
I have two sheets in an Excel document, Data 1 and Data 2.
Data 1 has Columns [Participant] and [Area].
Data 2 has the same columns but the [Area] is empty.
I would like to know how to fill in the [Area] in Data 2 based on [Participant] number?
Thank you in advance.
May 17 2019 05:46 AM
SolutionMay 17 2019 05:52 AM
@Sergei Baklan
It works beautifully! Thank you very much.
May 17 2019 07:09 AM
May 17 2019 07:20 AM
Kim, there are numbers as text in column C, and in lookup column we have numbers. Double dash converts texts to numbers. Same as VALUE() here.
May 17 2019 12:16 PM
I am not finding it necessary to use double dash to convert "FALSE" to 0 in Excel Office 365. I can just act as if FALSE is a 0 or TRUE is a 1 and use it in other formulas.
Cell A2 resolves to FALSE
CELL A3 contains =A2*3 and displays 0
Same behavior with TRUE. Double dash seems no longer necessary.
May 17 2019 02:55 PM
@Kim_Wennerberg , that's not about TRUE and FALSE, that's about MATCH
=MATCH("2",{1,2,3},0) returns #N/A =MATCH(--"2",{1,2,3},0) returns 2
May 17 2019 03:16 PM
I have a feeling that you are getting towards the size of problem where Power Query might offer the best solutions (this is included in the workbook).
Otherwise, searches are currently far more efficient if you sort the lookup table by participant.
Then the formula
=LOOKUP(VALUE([@Participant]), tblArea)
will look up a participant in the first column of tblArea and return the corresponding value from the second column.
p.s. If you are an Office 365 user I believe that this distinction between exact searches and binary searches will soon disappear as the field you are searching will be sorted in memory before the first search, making subsequent searches very fast.
May 18 2019 08:57 AM
@Peter Bartholomew , I don't think on 10-20 thousand rows with so simple range it could be any issues with performance with any approach. Minus of Power Query it requires refreshing. Not a big issue with static data, but if you add records from time to time and shall to shift from one table to another to check only one additional attribute - that could be annoying.
May 18 2019 09:51 AM - edited May 18 2019 09:52 AM
I am absolutely sure you are correct with the problem as it stands. Out of curiosity where would you put the balance point (if one has to switch to Calculation Manual the cut-off point has probably been passed)? Would you expect 10s of thousand searches over 100s of thousand values to go well? I don't have much experience with large datasets that bring Excel grinding to a halt!
Another factor that might influence the decision is 'How is the additional data input?' If a PQ append query offers the best route to import data, then one might choose to continue with the join query even when LOOKUP or INDEX/MATCH might otherwise be fast enough.
May 21 2019 09:04 AM
@Sergei Baklan
I tried to apply the same expression for different spreadsheets but it didn't work because of the wrong data type. Could you advise me how should I fix the error? I used your expression before and it worked on other sheets but not this one.
I want to look up the Dosage value in EVENT tab based on the Event Code columns for PARTICIPATION tab.
Thank you.
May 21 2019 09:04 AM
@Sergei Baklan
I tried to apply the same expression for different spreadsheets but it didn't work because of the wrong data type. Could you advise me how should I fix the error? I used your expression before and it worked on other sheets but not this one.
I want to look up the Dosage value in EVENT tab based on the Event Code columns for PARTICIPATION tab.
Thank you.
May 21 2019 10:22 AM
@KC_86 , you don't need double dash here since event code is the text in both sheets. Previous time you have numbers in one sheet and texts as numbers in another one.
=INDEX(EVENT!F:F,MATCH($E2,EVENT!E:E,0))
May 21 2019 10:24 AM
@Sergei Baklan
Thank you very much for your help again. Now it all made sense. I just tested the expression and it worked beautifully.
May 17 2019 05:46 AM
Solution