To appear in the 1851 census, you must be alive on 30/31 March 1851.
William Shackleton, with Sarah, is alive at the time of the 1851 census - aged 29 - living in Micklethwaite.
William Shackleton died 25 May 1851, and buried 28 May 1851 at Bingley, with informant as Sarah, is said to be aged 30.
Therefore, by a process of elimination, the William Shackleton who is buried 17 March 1849 in Keighley, aged 41, is probably

the William Shackleton who married Rose Hindle.