Tom Knowlton

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!

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

membership

Create a free account to see this answer

Signing up is free and takes 30 seconds.

**No credit card required.**ASKER CERTIFIED SOLUTION

membership

Create a free account to see this answer

Signing up is free and takes 30 seconds.

**No credit card required.**
đź‘Ť

ASKER