can you show the spreadsheet - you would need to replace the cells and calc with the actual values

I don't know if in yours it kept showing #name?
did you look at the attached spreadsheet and the formulas I used throughout , and you will see they all worked OK without #name error