Oct 27 2022 10:07 AM - edited Oct 27 2022 10:17 AM
Hello all,
I have data that comes to me in a long line of columns that are regularly switched around. Every week I need to move the columns to make the data conform to a spreadsheet that has a bunch of formulas.
Is there a formula I can use to make Excel tell me where to move the column?
What I have now outputs something like this:
Column Headers in correct order | Column Headers to be checked from worked files | Comparison Check |
A | A | Good |
B | C | Bad |
C | D | Bad |
D | B | Bad |
E | E | Good |
What I'd like is something where a formula told me how far to move a column. It would output something like this:
Column Headers in correct order | Column Headers to be checked from worked files | Comparison Check | Move Column: |
A | A | Good | 0 |
B | C | Bad | 1 |
C | D | Bad | 1 |
D | B | Bad | -2 |
E | E | Good | 0 |
So move Column C one place right, D one place right, and B two places left.
Is this possible?
Oct 27 2022 10:30 AM
SolutionOct 27 2022 10:58 AM
Oct 27 2022 11:00 AM
You are welcome! Thank you for the correction!
Oct 27 2022 11:13 AM
Oct 27 2022 12:18 PM
There are 16384 columns in an Excel sheet. Column XFD is column number 16384 and that is the limitation for the formula.
Oct 27 2022 12:57 PM
Oct 27 2022 01:17 PM
=CELL("col",INDIRECT(LEFT(A1,3)&"1"))
Do you want to return the column numbers for DVT, DVR and DVX?
Oct 28 2022 08:05 AM
@Quadruple_Pawn Not really.
What I'd like is for it to compare the positions of each item in the two lists, and see how far away from each other they are. So if the string "dvr_day_dept_fam_count" is in row 7 on the first list, and row 67 on the second list, I want it to tell me to move that string by 60 positions "up".
These two column headers lists are just a transposed list of headers. So when it tells me to move the 60 positions, I'll go to my second spreadsheet and move the column 60 positions left, which in our worksheet looks like 60 positions up.
Does that make sense? Is this possible?
Oct 28 2022 08:39 AM
Oct 28 2022 09:20 AM