In A2, enter formula:
=INDEX('INPUT SHEET'!$B$1:$AF$1,SMALL(IF(INDEX('INPUT SHEET'!$B$2:$AF$3,MATCH(A$1,'INPUT SHEET'!$A$2:$A$3,0),0)="OK",COLUMN('INPUT SHEET'!$B$2:$AF$3)-MIN(COLUMN('INPUT SHEET'!$B$2:$AF$3))+1),ROWS(A$2:A2)))
confirmed with CTRL+SHIFT+ENTER not just ENTER, then copy down and to next column. Format the results as General or Number.
If you really want to show as date in January, then try:
=DATE(2015,1,INDEX('INPUT SHEET'!$B$1:$AF$1,SMALL(IF(INDEX('INPUT SHEET'!$B$2:$AF$3,MATCH(A$1,'INPUT SHEET'!$A$2:$A$3,0),0)="OK",COLUMN('INPUT SHEET'!$B$2:$AF$3)-MIN(COLUMN('INPUT SHEET'!$B$2:$AF$3))+1),ROWS(A$2:A2))))
confirmed with CTRL+SHIFT+ENTER not just ENTER, then copy down and to next column. Format the results as Date. (Note the year and month are hard-coded into the formula here).
Bookmarks