| Imagine you have an Excel spreadsheet that contains | | | | BB |
| a list of values that appear in a single column, and lets | | | | DD |
| say this column contains id numbers. It happens that | | | | EE |
| the spreadsheet data was obtained from an invoices | | | | GG |
| list of the previous month, and you are asked to | | | | GG |
| obtain the number of unique customers from that list. | | | | KK |
| If the list contains less than 20 or 30 rows that could | | | | SS |
| be something you can easily do manually just by | | | | SS |
| looking and counting them, but what happens when | | | | 4. Go to cell B1 and type the following formula |
| the list contains 200 or even 3000 rows? | | | | (including the left "=" sign) and press Enter: |
| That's when you have to find a method to let | | | | =IF(A1=A2, 1, 0) |
| Microsoft Excel do the hard work, and you can | | | | 5. The value in B1 should be "1", because what the |
| achieve that by following the steps in this example: | | | | formula is doing is that when the value in cell A1 is |
| 1. Lets say you have these simple values in column A, | | | | equal to value in cell A2 then it should write a "1", else |
| starting from row 1 to row 10: | | | | it should show a "0". Copy cell B1 (Ctrl+C), and paste |
| BB | | | | it in cells B2 to B10, right next to every value on the |
| DD | | | | list we are using. |
| GG | | | | 6. This is the result we should get: |
| EE | | | | AA 0 |
| GG | | | | BB 1 |
| SS | | | | BB 0 |
| BB | | | | DD 0 |
| AA | | | | EE 0 |
| KK | | | | GG 1 |
| SS | | | | GG 0 |
| 2. First we have to get our data sorted, so we click | | | | KK 0 |
| on the first value (that would be cell A1 in the | | | | SS 1 |
| example), and then go up to the menu item called | | | | SS 0 |
| "Data" and select the option "Sort". | | | | Notice it? Using the IF formula we have found how |
| 3. The Sort window should appear, and by default it | | | | many repeated values exist in the list, which in this |
| will show the option "Sort by" and the value "Column | | | | case would be the three cells that have a "1" value |
| A". Press the OK button. That should have changed | | | | next to them. |
| our list into this: | | | | This method will save you a lot of time and effort, |
| AA | | | | so practice it as much as you can! |
| BB | | | | |