Skip to main content

Automatically calculate zodiac signs based on ID number

The calculation logic of the zodiac is based onYear of birth(7 to 10 digits) judge the zodiac sign by seeking the remainder of 12; 7 to 12 digits of the birth certificate number are the year of birth of the corresponding member of the ID card.

1. IF function calculation

Use the IF function to list all kinds of situations, and automatically calculate zodiac signs IF the conditions are met.

The following code can be directly copied to the formula editor,Replace the ID number field.

{"text":"IF(EQ(LEN(​身份证号​),18),IF(EQ(MOD(VALUE(MID(​身份证号​,7,4)),12),0),\"猴\",IF(EQ(MOD(VALUE(MID(​身份证号​,7,4)),12),1),\"鸡\",IF(EQ(MOD(VALUE(MID(​身份证号​,7,4)),12),2),\"狗\",IF(EQ(MOD(VALUE(MID(​身份证号​,7,4)),12),3),\"猪\",IF(EQ(MOD(VALUE(MID(​身份证号​,7,4)),12),4),\"鼠\",IF(EQ(MOD(VALUE(MID(​身份证号​,7,4)),12),5),\"牛\",IF(EQ(MOD(VALUE(MID(​身份证号​,7,4)),12),6),\"虎\",IF(EQ(MOD(VALUE(MID(​身份证号​,7,4)),12),7),\"兔\",IF(EQ(MOD(VALUE(MID(​身份证号​,7,4)),12),8),\"龙\",IF(EQ(MOD(VALUE(MID(​身份证号​,7,4)),12),9),\"蛇\",IF(EQ(MOD(VALUE(MID(​身份证号​,7,4)),12),10),\"马\",\"羊\"))))))))))),\"\")","marks":[{"from":{"line":0,"ch":10,"sticky":null},"to":{"line":0,"ch":16,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":42,"sticky":null},"to":{"line":0,"ch":48,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":86,"sticky":null},"to":{"line":0,"ch":92,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":130,"sticky":null},"to":{"line":0,"ch":136,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":174,"sticky":null},"to":{"line":0,"ch":180,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":218,"sticky":null},"to":{"line":0,"ch":224,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":262,"sticky":null},"to":{"line":0,"ch":268,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":306,"sticky":null},"to":{"line":0,"ch":312,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":350,"sticky":null},"to":{"line":0,"ch":356,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":394,"sticky":null},"to":{"line":0,"ch":400,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":438,"sticky":null},"to":{"line":0,"ch":444,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":482,"sticky":null},"to":{"line":0,"ch":488,"sticky":null},"value":"textField_ksfyitkm","invalid":false}],"isCmData":true}
  • IF
  • EQ(value1,value2) returns true when two values are equal. It supports numbers and dates.
  • LEN(text):Returns the number of characters in a text string.
  • VALUE(): converts the string retrieved by the MID function into a number.
  • MOD(number, divisor): returns the remainder of the division of two numbers.
  • MID(A,B,C): in A string, C characters are retrieved from bit B.

Calculate Zodiac

2. Video demonstration

此处为语雀视频卡片,点击链接查看:根据身份证号自动计算生肖.mov

Calculation Zodiac video explanation

3. For more information about identity, please read the document.👇:

1.Automatically calculate birthday based on ID number

2.Automatically calculate gender based on ID number

3.Automatically calculate constellation based on ID number

4.Automatically calculate province based on ID number

YIDA in order to better optimize the content and quality of YIDA user manual, it takes you 3-5 minutes to fill in the document feedback questionnaire. The document feedback questionnaire is submitted anonymously, and the questionnaire information is only used for YIDA document experience feedback collection. Thank you for your support for YIDA!

Click here to fill in the questionnaire


-------------------- Get the latest information YIDA, welcome to follow US--------------------

This doc is generated using machine translation. Any discrepancies or differences created in the translation are not binding and have no legal effect for compliance or enforcement purposes.
Copyright © 2024钉钉(中国)信息技术有限公司和/或其关联公司浙ICP备18037475号-4