Initial layout
I am attempting to auto fill column C with type column B title, from the nth instance where column A = "D", and to automatically populate the value, until the next occurrence of A = "D", then use the next instance where column A = "D".
Desired output



Use XLOOKUP that searches from the bottom up and use dynamic ranges:
Or if you want it to spill:
Then there is the simply dragdown formula: