Amend Cells based on columns and rows

@kanishka271 maybe you could provide us with a full set of data and an example of what the result should look like - covering all the options that might occur?