Home  >  Article  >  Topics  >  How to determine gender using mod function

How to determine gender using mod function

藏色散人
藏色散人Original
2020-05-11 10:24:1010385browse

How to determine gender using mod function

How to determine gender by mod function

The first step, everyone knows that the second to last digit on the ID card Parity determines people's gender, so. Before we use the excel function, we need to analyze its principle. Since we judge based on the penultimate digit, right, our first step is to take out the number, then judge the parity of the number, and finally use the if function To make logical judgments, let’s do it step by step.

Recommendation: "Excel Tutorial"

Enter the certificate number first. Before entering, please note that Change the cell format to text format,

How to determine gender using mod function

Use the interception string functions left(), right(), mid(), of course, the penultimate digit of the ID card is located In the middle of the string, so here we use the mid() function to extract characters.

How to determine gender using mod function

Use the mod() remainder function to determine parity. The divisor is 2. If the remainder If it is 0, it is an even number, and vice versa. Everyone knows this.

How to determine gender using mod function

Finally, use the if() function for logical judgment. Everyone knows how to use this. You can find out as shown below.

How to determine gender using mod function

The above is the detailed content of How to determine gender using mod function. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn