+ Reply to Thread
Results 1 to 5 of 5

Index function ALMOST works!

Hybrid View

  1. #1
    Registered User
    Join Date
    09-30-2008
    Location
    Madison, WI
    Posts
    2

    Index function ALMOST works!

    Hi,

    I'm stuck with an indexing problem. The value that is returned is off by 2 rows everytime. When I evaluate the formula, it shows the correct row just before the indexing function does it's thing.

    I have a cell phone bill for 20 or so phones and am trying to isolate one number at a time and evaluate usage. The first sheet is my data, the second is sheet ("Breakdown") is where I enter the number in A2 that I want to look at. When I do, it misses the first 2 rows and picks up 2 extra from the following phone number.

    I'll attach and see if anyone can help. Thanks in advance!
    Attached Files Attached Files
    Last edited by moxnix; 03-31-2009 at 03:42 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Index function ALMOST works!

    You're returning the physical ROW value in the array so you either need to adjust this by -2 to account for the fact that rows 1 & 2 don't exist in the INDEX range (ie physical row 3 = row 1 in the INDEX range) or change the INDEX to start from row 1 and not row 3... I pefer the latter.

    Have you thought of using a Pivot Table ?

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Index function ALMOST works!

    Your syntax on the Small(if) array needed a little tweaking:

    =IF(ROWS($A$4:$A4)>COUNTIF('Original Data'!$A$1:$A$1000,$A$2),"",INDEX('Original Data'!$A$1:$A$1000,SMALL(IF('Original Data'!$A$1:$A$1000=$A$2,ROW($A$1:$A$1000),""),ROWS($A$4:$A4))))

    The section in blue really needs to start at row1, and as such best to go ahead and start them all there. The first two rows will be skipped anyway, so including them is harmless.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    09-30-2008
    Location
    Madison, WI
    Posts
    2

    Re: Index function ALMOST works!

    DonkeyOte - I thought that was what I was doing by including the Row()-3. I have THOUGHT of using a Pivot Table, but not real sure how. I cherry picked this formula from this forum a while back and used it on a diffent spreadsheet wonderfully.

    JBeaucaire - That worked!

    Thanks to both of you for your speedy responses!!!

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Index function ALMOST works!

    If that takes care of your need, be sure to EDIT your original post (Go Advanced) and mark the PREFIX box [SOLVED]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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