Skip to main content

Automatically calculate constellation based on ID number

Constellations are matched based on the date of birth (11 to 14 digits); For example, when the date of birth is Aries between March and April, other constellations continue to be compiled accordingly.

1. IF function determination

Use the IF function to write the formula.

IF(A,B,IF(C,D,E) is understoodIf A is satisfied, B is returned; If A is not satisfied but C is satisfied, D is returned; If both A and C are not satisfied, E is returned.

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

{"text":"IF(EQ(LEN(​身份证号​),18),IF(AND(GE(VALUE(MID(​身份证号​,11,4)),321),LE(VALUE(MID(​身份证号​,11,4)),419)),\"白羊座\",IF(AND(GE(VALUE(MID(​身份证号​,11,4)),420),LE(VALUE(MID(​身份证号​,11,4)),520)),\"金牛座\",IF(AND(GE(VALUE(MID(​身份证号​,11,4)),521),LE(VALUE(MID(​身份证号​,11,4)),621)),\"双子座\",IF(AND(GE(VALUE(MID(​身份证号​,11,4)),622),LE(VALUE(MID(​身份证号​,11,4)),722)),\"巨蟹座\",IF(AND(GE(VALUE(MID(​身份证号​,11,4)),723),LE(VALUE(MID(​身份证号​,11,4)),822)),\"狮子座\",IF(AND(GE(VALUE(MID(​身份证号​,11,4)),823),LE(VALUE(MID(​身份证号​,11,4)),922)),\"处女座\",IF(AND(GE(VALUE(MID(​身份证号​,11,4)),923),LE(VALUE(MID(​身份证号​,11,4)),1023)),\"天秤座\",IF(AND(GE(VALUE(MID(​身份证号​,11,4)),1024),LE(VALUE(MID(​身份证号​,11,4)),1122)),\"天蝎座\",IF(AND(GE(VALUE(MID(​身份证号​,11,4)),1123),LE(VALUE(MID(​身份证号​,11,4)),1221)),\"射手座\",IF(AND(GE(VALUE(MID(​身份证号​,11,4)),120),LE(VALUE(MID(​身份证号​,11,4)),218)),\"水瓶座\",IF(AND(GE(VALUE(MID(​身份证号​,11,4)),219),LE(VALUE(MID(​身份证号​,11,4)),320)),\"双鱼座\",\"摩羯座\"))))))))))),\"\")","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":74,"sticky":null},"to":{"line":0,"ch":80,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":120,"sticky":null},"to":{"line":0,"ch":126,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":152,"sticky":null},"to":{"line":0,"ch":158,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":198,"sticky":null},"to":{"line":0,"ch":204,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":230,"sticky":null},"to":{"line":0,"ch":236,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":276,"sticky":null},"to":{"line":0,"ch":282,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":308,"sticky":null},"to":{"line":0,"ch":314,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":354,"sticky":null},"to":{"line":0,"ch":360,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":386,"sticky":null},"to":{"line":0,"ch":392,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":432,"sticky":null},"to":{"line":0,"ch":438,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":464,"sticky":null},"to":{"line":0,"ch":470,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":510,"sticky":null},"to":{"line":0,"ch":516,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":542,"sticky":null},"to":{"line":0,"ch":548,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":589,"sticky":null},"to":{"line":0,"ch":595,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":622,"sticky":null},"to":{"line":0,"ch":628,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":669,"sticky":null},"to":{"line":0,"ch":675,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":702,"sticky":null},"to":{"line":0,"ch":708,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":749,"sticky":null},"to":{"line":0,"ch":755,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":781,"sticky":null},"to":{"line":0,"ch":787,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":827,"sticky":null},"to":{"line":0,"ch":833,"sticky":null},"value":"textField_ksfyitkm","invalid":false},{"from":{"line":0,"ch":859,"sticky":null},"to":{"line":0,"ch":865,"sticky":null},"value":"textField_ksfyitkm","invalid":false}],"isCmData":true}
  • IF
  • LEN(text): returns the number of characters in a text string
  • AND(A, B, …): meet both A and B...
  • MID(A,B,C): in A string, C characters are retrieved from bit B.
  • VALUE(): converts the string retrieved by the MID function into a number.
  • GE(value1,value2): value1 greater than or equal to value2 returns true, supports numbers, date
  • LE(value1,value2):value1 is less than or equal to value2 and returns true. Numbers and dates are supported.

Computing constellation

2. Case demonstration

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

Automatic constellation calculation video demonstration

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 province based on ID number

4.Automatically calculate zodiac signs 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