Forum Discussion

saleemch's avatar
saleemch
Copper Contributor
Nov 30, 2019
Solved

Conversion of data into single column

  Hi all, I need to convert multiple columns data into one columns. The columns represent yearly flows and may have 365 or 366 values. Could any body suggest me code to convert data into one column ...
  • SergeiBaklan's avatar
    SergeiBaklan
    Nov 30, 2019

    saleemch 

    Okay. Let define named range for the values as

    where first row is the row with years and couple of empty rows at the end as the gap.

    Transferred data will put here

    In BF3 is the formula to calculate the date starting from the first one in our range

    =DATE(INDEX(rngValues,1,1),1,ROW()-ROW($BF$2))

    into BG3 we pick-up the value from the range

    =IFNA(INDEX(rngValues,$BF3-DATE(YEAR($BF3),1,1)+2,MATCH(YEAR($BF3),INDEX(rngValues,1,0),0)),"out of range")

    Let stay on BF3 and in reference box will enter

    Entire this range will be selected. Now press Ctrl+D, formulas from BF3:BG3 will be expanded till end of this range.

    Right now for leap years with have zero for 31 Dec. I didn't add any values, add them yourself where necessary.

    Please check in second sheet of the attached file.

Resources