在电子表格中,是否有一种快速检查单元格中数据属性的方法?

huangapple go评论71阅读模式
英文:

Is there a way to quickly check what attribute the data is in a cell in a spreadsheet?

问题

我知道我们可以轻松地转换或更改单元格中的数据属性,并且有快捷方式可供使用,但是否有一种方法可以检查列中的数据或数据列表是否保存为int/string/date等?

我想要能够快速检查列中的数据是否以正确的格式/属性保存,而不必再次进行转换/更改以确保。

英文:

I know we can easily convert or change the attribute to of data in a cell quickly and there are shortcuts for it but is there a way to check if a data or list of data in a column is saved as an int/string/date/etc?

I would like to be able to just quickly check if the data I have in a column is saved in the correct format/attribute without having to convert/change it again just to make sure.

答案1

得分: 0

Excel会自动做出关于数据的假设。与Python或其他编程语言不同,Excel没有数据类型。可以使用函数来测试单元格的值。

可以使用以下函数来查看数据类型:

  • ISTEXT():文本
  • ISBLANK():空白
  • ISNUMBER():数字
  • ISLOGICAL():布尔值
  • ISERR():错误

如果你想知道B5单元格的数据类型,可以使用以下公式:

=IFS(ISTEXT(B5),"文本",ISBLANK(B5),"空白",ISNUMBER(B5),"数字",ISLOGICAL(B5),"布尔值",ISERR(B5),"错误")

要将数字转换为字符串,在数字前加上单引号,例如 '50。在Excel中,日期也是一个数字。要将存储为字符串的数字转换为数字,可以乘以1。

此外,还有一个函数CELL(),可以用来查看单元格的格式,如下所示:

=CELL("format", B5)

你可以在此处查看有关该函数的详细信息:CELL函数详细信息

英文:

Excel will make assumptions of what the data is automatically. There is no datatype like in python or other coding languages. There are functions for testing cells values.

Functions to look at istext(), isblank(), isnumber(), islogical(), iserr(), ...

so if you want to know the data type in B5.

=IFS(ISTEXT(B5),"String",ISBLANK(B5),"Null",ISNUMBER(B5),"Number",ISLOGICAL(B5),"Boolean",ISERR(B5),"Error")

To convert a number to a string use the single quote mark prior to the number like '50. A date in excel is also a number. To convert a number stored as a string into a number multiply by 1.

Edit---

There is a fuction =Cell() see the details here
=CELL("format",B5)

huangapple
  • 本文由 发表于 2023年1月6日 14:02:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/75027471.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定