帮我在execl单元格内写一个认证身份证是否正确的公式
时间: 2023-04-07 09:02:47 浏览: 165
可以使用以下公式来认证身份证是否正确:
=IF(AND(LEN(A1)=18,ISNUMBER(VALUE(LEFT(A1,17))),IF(MOD(SUMPRODUCT(VALUE(MID(A1,ROW(INDIRECT("1:17")),1)),{7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2}),11)=1,TRUE,FALSE)), "身份证号码正确", "身份证号码错误")
其中,A1为要认证的身份证号码所在的单元格。如果身份证号码正确,单元格内会显示"身份证号码正确",否则会显示"身份证号码错误"。
相关问题
html execl 单元格内换行
如果您想在 Excel 单元格内插入换行符,可以按下 Alt + Enter 键。或者,您也可以在单元格内使用以下 HTML 代码来插入换行符:
```
<br>
```
例如,如果您想在单元格内插入两行文本,可以输入以下内容:
```
第一行文本<br>第二行文本
```
这将在单元格中显示两行文本,每行文本分别显示在不同的行上。
WPS js 判断Execl单元格是否为空
在WPS中使用JavaScript来判断Excel单元格是否为空,可以通过以下方法实现:
1. **获取单元格的值**:首先,需要获取要检查的单元格的值。
2. **判断单元格是否为空**:使用JavaScript的逻辑判断来检查单元格的值是否为空。
以下是一个示例代码,演示如何判断Excel单元格是否为空:
```javascript
function isCellEmpty(range) {
// 获取单元格的值
var cellValue = range.value;
// 判断单元格是否为空
if (cellValue === null || cellValue === "") {
return true; // 单元格为空
} else {
return false; // 单元格不为空
}
}
// 使用示例
var sheet = wps.EtApplication().ActiveSheet;
var cell = sheet.Range("A1");
if (isCellEmpty(cell)) {
console.log("单元格A1为空");
} else {
console.log("单元格A1不为空");
}
```
在这个示例中,`isCellEmpty`函数接收一个单元格范围(`range`)作为参数,并返回布尔值,指示该单元格是否为空。`wps.EtApplication().ActiveSheet`用于获取当前活动的工作表,`sheet.Range("A1")`用于获取A1单元格的范围。
阅读全文
相关推荐












