Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to get cell type or cell value type #417

Closed
Mindzy opened this issue Jun 5, 2019 · 3 comments
Closed

Need to get cell type or cell value type #417

Mindzy opened this issue Jun 5, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@Mindzy
Copy link

Mindzy commented Jun 5, 2019

Description
GetCellStyle() only gets the style index, which is integer, of a cell. And the style index can't be related to a certain cell format. I need to get the cell format, like general, date, time, percentage, number, text. Or cell value type like int, string, float64, bool. Since Excel stores date and time as int and float, date or time format can be return as float.

Describe the results you expected:

-- A B
1 Mike 23
2 Sarah 20

GetCellType(sheet, "A1")
string
GetCellType(sheet, "B1")
int

@Mindzy
Copy link
Author

Mindzy commented Jun 5, 2019

Also, some numbers in Excel can be stored as text by add ' before numbers.

-- A B
1 Mike 23
2 Sarah '20

GetCellType(sheet, "A1")
string
GetCellType(sheet, "B1")
int
GetCellType(sheet, "A2")
string
GetCellType(sheet, "B2")
string

@acidobinario
Copy link

no progress on this?

@xuri xuri added the enhancement New feature or request label Mar 13, 2020
@xuri xuri closed this as completed in dad8f49 Sep 9, 2021
@xuri
Copy link
Member

xuri commented Sep 9, 2021

Thanks for your issue, I have added a new API GetCellType to support get cell data type, please upgrade to the master branch code.

jenbonzhang pushed a commit to jenbonzhang/excelize that referenced this issue Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants