the input is:

need output as:

is this possible in just XL format or a python script is required. if yes can you help with python script? thanks.
my script: my logic is read each df.col and compare value from 1 to 20, if equal write it out or write blank.
import pandas as pd
df = pd.read_excel(r"C:\Users\my\scripts\test-file.xlsx")
print(df)
for column in df.columns[0:]:
print(df[column])
Here's one approach:
Sample df
Code
Explanation
max_value) for the max value in thedf(to be used later for reindexing).df.stackto get all your columns as one stackedpd.Series(here:out).idx) usingpd.MultiIindex.from_arrays. For the first array pick the second level from the index (use:pd.MultiIndex.get_level_values); for the second array, use the values.idxas the index withSeries.set_axis, applySeries.unstack, and useSeries.reindexto add the missing index values (withnp.nanvalues).