function rowletter=get_rowletter(rownumber,format)
%Fred Cross June 2016 The Rockefeller University

if format==100
    maxrow=13;
else
    maxrow=2*sqrt(format/6);
end

    if rownumber>maxrow
        fprintf('Max row %d for %d format\n',maxrow,format);
        rowletter='?';
    else
        if rownumber<=26
            rowletter=char('A'+rownumber-1);
        else
            letter1=char('A'+floor(rownumber/26)-1);
            letter2=char('A'+mod(rownumber,26)-1);
            rowletter=[letter1,letter2];
        end
        if rownumber==52
            rowletter='AZ';
        end
        
    end