If you're happy for the date columns to be in the same order (not reversed as you have them), it makes the formulae a LOT easier, then you should start with only columns A & B containing codes and co. names, along with as many columns as contain prices, and NOTHING else on the sheet then this macro will add the price differences and 1s and zeroes in new columns to the right. Check the comments in the code for whether you want the formulae to remain or not.
The macro blah works on whichever sheet is the active sheet, so be careful that it's the right sheet. Button at cell D3 on sheet runs that macro.
I'll leave the sorting of the data to you, there's no need to have it sorted to calcuate the values in the new columns.
I dont see a 'sp1' sheet so haven't done any copying of data.
Bookmarks