Link to home
Create AccountLog in
Avatar of Tom Knowlton
Tom KnowltonFlag 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!
SOLUTION
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
ASKER CERTIFIED SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of Tom Knowlton

ASKER

Thank you
đź‘Ť