Search code examples
excellineformulamultiple-columnsrows

Excel Line up columns within rows


Within Excel I need to be able to line up the last two columns within each row. I have around 1000+ rows of "messy data". The last two columns include bank account number and sort code. They will always be the last two columns but differ which column there are in for each row. I need the account number and sort code to be in column J & K. Screen shot below. excel spreadsheet example


Solution

  • You can use INDEX/COUNTA:

    =INDEX($A1:$H1,COUNTA($A1:$H1)-(2-COLUMN(A:A)))
    

    copy over one and down the length of the data.

    enter image description here