public int ConvertCellTextToNumber(string columnName) // A => 1
{
if (string.IsNullOrEmpty(columnName)) return -1;
columnName = columnName.ToUpperInvariant();
int sum = 0;
for (int i = 0; i < columnName.Length; i++)
{
sum *= 26;
sum += (columnName[i] - 'A' + 1);
}
return sum;
}