+ Reply to Thread
Results 1 to 5 of 5

Using Index, Small, If, and Row functions but determining when to continue counting!!!

  1. #1
    Registered User
    Join Date
    06-16-2014
    Location
    United States
    MS-Off Ver
    MS Office 2010
    Posts
    2

    Using Index, Small, If, and Row functions but determining when to continue counting!!!

    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??

  2. #2
    Forum Contributor
    Join Date
    10-07-2011
    Location
    India, Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    212

    Re: Using Index, Small, If, and Row functions but determining when to continue counting!!!

    Can you please attached sample excel sheet with expected result.

    Regards,
    Suhas

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Using Index, Small, If, and Row functions but determining when to continue counting!!!

    Try this array formula to see if you get the desired output.

    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  4. #4
    Registered User
    Join Date
    06-16-2014
    Location
    United States
    MS-Off Ver
    MS Office 2010
    Posts
    2

    Re: Using Index, Small, If, and Row functions but determining when to continue counting!!!

    The example I gave in my explanation is on a large file at my work that Im not aloud to upload. In this example I put the data into two small tables. One of the tables links states and zips, the other links zips and building #'s (all data is made up).I want to enter
    "Florida" in the input box. I then want cells I5:J19 to appear. In cell I7 I used my formula I previously stated (changing the range and cells to match this example). When I drag it down it fills like the range M5:N19 in the Zip code column. Notice I want the second zip code to appear in I12 once the buildings are done being listed but Im getting the 6th zip code for florida in I12 because its making them go in order. I want it to skip and not list the next occurance until the building #'s for the previous one is done being listed. I made the last number in the building # column = 0 because once this function runs out of instances it places a N/A. I formatted this to give this value a 0. I thought maybe I could use an if statement to say when a cell 1 up and 1 over is 0 display the next instance of the zip code.
    Attached Files Attached Files

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Using Index, Small, If, and Row functions but determining when to continue counting!!!

    see the attached file
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Formula using INDEX, SMALL, and ISERROR functions gives skewed results
    By rspells in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-09-2013, 03:32 AM
  2. Problem with Index and Small functions to lookup and display multiple cells
    By oneblondebrow in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 04-22-2013, 11:41 AM
  3. Functions similar to SMALL or overcome limitations of SMALL
    By arvindtechie in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-05-2013, 10:59 AM
  4. Can't find the error functions INDEX () and SMALL()
    By HyperG in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-28-2012, 12:20 AM
  5. Replies: 1
    Last Post: 04-01-2011, 12:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1