I have been trying to figure this out and can't find a problem online like this anywhere. Basically I have a table with 3 columns. State, Zip Code, and Building #. There are several zip codes per state and several building #'s per zip code. Since there are multiple values I want to find Im using the index function instead of vlookup. My function looks similar to this (Im using a random row to stop on when I say C50:
=Index($A$3:$C$50,Small(If($A$3:$A$50=F1,Row($A$3:$A$50)),Row(1:1)),2)
I want to type in the State in cell F1. This will populate F3 - however many zips are in that state in the table. Now I know I could use this formula or one very similar and press CTRL+SHIFT+ENTER and get the first zip code to show in cell F3. If I drag this down it will populate the following columns with all instances of that state as the zip code increase. In the formula the Row(1:1) will change to Row(2:2) and Row(3:3) respectively. In the column next to this one and one cell down (G4) I want the first building to show for that zip. This can be done using index function looking for the value of F3 and dragging down using the same process. My problem is I was the initial index function the one finding zip code from the state to not use Row(2:2) in F4 but to use it once the building # from the previous zip code is done listing. There isnt a set number for all zip codes and buildings so they wont be evenly spaced. I formatted the building # to display 0 once all were listed and tried to say the 2nd zip code to display when the column up and to the right of it ( which would be the last building # of the previous zip) is zero using an if statement and it worked but if it was 5 cells down it would use Row(5:5) which is the 5th instance of the zip code corresponding to the state. I want it to be the second instance because I basically am skipping zip codes. Is this possible to do??
Bookmarks