Avatar of Tom Knowlton
Tom Knowlton
Flag for United States of America

asked on 

Convert Excel Cell coords to x,y ( C# )

In C#, I need code that will convert an Excel column / row coordinate to zero-based x,y (ordinal) values.  Assume no VSTO or Interop support.

I need to support the following:

A1 (0, 0)
A500  (500, 0)
AA1   (0, 26)
AA500 (500, 26)
XFD5 (5, 16384)   (which is as far as I can go, column-wise)


*** NOTE:  in Excel you can obtain the column value with formula:

=COLUMN(XFD5)

But like I said, I need to be able to do this programmatically in C# without the benefit of Excel Interop or VSTO.

Thank you!
.NET ProgrammingC#

Avatar of undefined
Last Comment
Fernando Soto

8/22/2022 - Mon