Forum Discussion
Philippe
Aug 02, 2017Copper Contributor
help with coding via comparison operators!
Hello, I've got a data set of about 1000 cells that I'm trying to have excel lump into categories. This is my coding sequence: Age 65-74 - 0 75-84 - 1 85-94 - 2 95+ - 3 I'm strug...
Aug 02, 2017
Hello,
consider the following screenshot:
The age thresholds are listed in column A. Note that you only need the start of the age bracket. Then you can lookup the value with a VLookup formula that uses an approximate match. The formula in cell E3 is
=VLOOKUP(E2,$A$1:$B$5,2,TRUE)
An approximate match requires that the data is sorted ascending in column A. Then the formula will match the age in column A that is smaller than or equal to the age in E2 and return the value in the corresponding cell in column B.