Excel Formula is Resulting in a #N/A! Error

Excel Formula is Resulting in a #N/A! Error

Hi!

I just converted my current excel work book to Zoho Sheet and I am going through the process of debugging. 
I have a formula that I currently use in excel that looks up the text in a column and a numeric value in another row. The formula should allow me to create a list repeating the text based off of a given value.

Example:

A        B                             G
John   2                         John
Tom   3                         John
                                      Tom
                                      Tom
                                      Tom 
The formula is:
=LOOKUP(ROWS(A$1:A1);SUMIF(OFFSET(B$1;;;ROW($1:$20););"<>")+1;A$2:A$16)&""

However, when I use this it results in an error. All values are in the correct associated cells. Can anyone see what may be causing this? Strangely enough in some cells the correct text populates, but I can not seem to figure out why.

Thanks for any help!