Hi all, I must have been here 100 times when googling excel queries, always sorted it. This is the first time I've been stumped though. I'm a moderate excel user and just can't get my head around this one. Will try and lay it out concisely as I can.
Have man handled the data so I have one unique reference in one cell for each column / period.
Logic wise, I want to return the Column & Row (really just row) reference that this unique value sits in within C3:I6 (that I have generated using the ID with the helper columns above) and return the value in column A corresponding to that row.
I got this working reasonably easily / quickly with an offset formula, however it is incredibly slow (as it's dynamic?). I have 27 columns and 200,000+ rows, likely that'll expand to more rows. (And in actual fact, 12 data columns I want to return, not just A, same formula but different return column. Lots of formula / data and the workbook already has a lot of others besides this).
Index and match should be quicker? However I run into issues as the reference is dynamic and haven't figured a way around that with offset, even turning the match funding into a column Letter and trying to push that into the formula (I recall, doing that somehow before and it being a mess, I think using INDIRECT back in the mists of time in my memory).
Also recall SUMPRODUCT can be used to turn a specific combination of values in a table range such as this, but it won't return the value I want in this setup. If it was just 1 bit of data I wanted I could place it (the value in Column A) in the C3:16 range and return that I think, combination of helper column and ID, however I have 12 of these so would be 12x27 tables / ranges I'd need to create?
Example that works ('POS Data' is the name of the worksheet).
=XLOOKUP([A Cell with the Unique reference]0014-1,OFFSET('POS DATA'!$C:$C,0,(1-[cell with the helper #])),'POS DATA'!A:A [or A:A, B:B,D:D in reality etc. 12 columns),0,1) .i.:
=XLOOKUP(0014-1,OFFSET('POS DATA'!$C:$C,0,(1-4)),'POS DATA'!A:A,0,1)
This will look for the helper column number (1,2,3,4, etc.) using offset, lookup that column and return the value in Column A where it finds the Unique ID in that column. Might have gotten the add or subtract on offset wrong here from memory but with a fiddle it works. Having foxed ranges rather than full columns would speed it up but not sure by much and causes issues with staff using it and adding rows / needing to update ranges.
Lot of waffle that may be hard to follow above- Question is how can I achieve this with a formula that won't drag the worksheet to a crawl? I have to had this off to staff to process and want to avoid giving them a formula that they need to copy, paste, run then range value to make the sheet useable again.
I tried adding out more helper columns e.g. with a max and min column helper reference (the 1-6) and using IF / AND statements but got a but lost there as well. Have filled the columns with other data "Yes", "0014" etic. rather than unique but couldn't use that either.
Feel like I'm just missing the right helper column, step of logic and a simple formula but now have lost objectivity and am frazzled.
Hope this is clear enough some 1 second send of (experienced) eyes can help me out, cheers folks.
A | B | C | D | E | F | G | H | I |
1 | 2 | 3 | 4 | 5 | 6 | 6 | ||
Data I want | ID | Title 1 | Title 2 | Title 3 | Title 4 | Title 5 | Title 6 | Title 7 |
Code AAA | 0014 | 0014-7 | ||||||
Code BBB | 0014 | 0014-6 | ||||||
Code CCC | 0014 | 0014-4 | 0014-5 | |||||
Code CCC | 0014 | 0014-1 | 0014-2 | 0014-3 |
Have man handled the data so I have one unique reference in one cell for each column / period.
Logic wise, I want to return the Column & Row (really just row) reference that this unique value sits in within C3:I6 (that I have generated using the ID with the helper columns above) and return the value in column A corresponding to that row.
I got this working reasonably easily / quickly with an offset formula, however it is incredibly slow (as it's dynamic?). I have 27 columns and 200,000+ rows, likely that'll expand to more rows. (And in actual fact, 12 data columns I want to return, not just A, same formula but different return column. Lots of formula / data and the workbook already has a lot of others besides this).
Index and match should be quicker? However I run into issues as the reference is dynamic and haven't figured a way around that with offset, even turning the match funding into a column Letter and trying to push that into the formula (I recall, doing that somehow before and it being a mess, I think using INDIRECT back in the mists of time in my memory).
Also recall SUMPRODUCT can be used to turn a specific combination of values in a table range such as this, but it won't return the value I want in this setup. If it was just 1 bit of data I wanted I could place it (the value in Column A) in the C3:16 range and return that I think, combination of helper column and ID, however I have 12 of these so would be 12x27 tables / ranges I'd need to create?
Example that works ('POS Data' is the name of the worksheet).
=XLOOKUP([A Cell with the Unique reference]0014-1,OFFSET('POS DATA'!$C:$C,0,(1-[cell with the helper #])),'POS DATA'!A:A [or A:A, B:B,D:D in reality etc. 12 columns),0,1) .i.:
=XLOOKUP(0014-1,OFFSET('POS DATA'!$C:$C,0,(1-4)),'POS DATA'!A:A,0,1)
This will look for the helper column number (1,2,3,4, etc.) using offset, lookup that column and return the value in Column A where it finds the Unique ID in that column. Might have gotten the add or subtract on offset wrong here from memory but with a fiddle it works. Having foxed ranges rather than full columns would speed it up but not sure by much and causes issues with staff using it and adding rows / needing to update ranges.
Lot of waffle that may be hard to follow above- Question is how can I achieve this with a formula that won't drag the worksheet to a crawl? I have to had this off to staff to process and want to avoid giving them a formula that they need to copy, paste, run then range value to make the sheet useable again.
I tried adding out more helper columns e.g. with a max and min column helper reference (the 1-6) and using IF / AND statements but got a but lost there as well. Have filled the columns with other data "Yes", "0014" etic. rather than unique but couldn't use that either.
Feel like I'm just missing the right helper column, step of logic and a simple formula but now have lost objectivity and am frazzled.
Hope this is clear enough some 1 second send of (experienced) eyes can help me out, cheers folks.