First prepare the cell structure in Excel.
Enter the function formula for querying provinces based on cities.
1. In cell A7, enter the function formula for querying provinces based on city "=INDEX($1:$1,MAX(IF($A$2:$D$4=A7,COLUMN(A:D))) ))", please note that all characters in the formula are English characters, and errors will occur when entering Chinese characters;
2. Press the three keys "Ctrl", "Shift" and "Enter" at the same time.
The results are as follows:
Recommended tutorial: excel tutorial
The above is the detailed content of Excel automatically identifies provinces based on cities. For more information, please follow other related articles on the PHP Chinese website!