+ Reply to Thread
Results 1 to 4 of 4

Code Explanation Help Please

  1. #1
    Registered User
    Join Date
    09-19-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    2

    Question Code Explanation Help Please

    Hi Guys,

    I am at my Witts end, I am an Access VBA programmer by trade but have been asked to look at some excel stuff for a friend.

    Can anyone, even if just a little bit, Explain what is going in in this code? I know its a very ambiguous question but I am ready to chuck the PC out the window.

    The Code is

    =IF(ISERROR(INDEX(Log!$F$1:$S$1100,SMALL(IF(Log!$F$1:$F$1100=Categories!$B$2,ROW(Log!$F$1:$S$1100)),ROW(1:1)),3)),"",INDEX(Log!$F$1:$S$1100,SMALL(IF(Log!$F$1:$F$1100=Categories!$B$2,ROW(Log!$F$1:$S$1100)),ROW(1:1)),11))

    What it does is take information from worksheet - Log and populate it into a new sheet where this formula is present. The criteria is that the categorie will match a specific field in the sheet.

    I am not familiar with the terms INDEX, SMALL and ROW. I have done a little research but its all far more basic than this and i cant make head nor tail of it. Especially ROW(1:1)),3) and ROW(1:1)),11)

    Any Help would be amazing

    Thanks in advance

    Sean

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Code Explanation Help Please

    Hello gerbansprawl What you want to know about above formula

  3. #3
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Code Explanation Help Please

    basically Index formula Returns the value of an element in a table or an array, selected by the row and column number
    syntax for index formula is : INDEX(array,row_num,column_num)

    Here in below formula
    INDEX(Log!$F$1:$S$1100,SMALL(IF(Log!$F$1:$F$1100=Categories!$B$2,ROW(Log!$F$1:$S$1100)),ROW(1:1)),3))
    Log!$F$1:$S$1100= array or range
    SMALL(IF(Log!$F$1:$F$1100=Categories!$B$2,ROW(Log!$F$1:$S$1100)),ROW(1:1)) = row number
    3=Columnnumber

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Code Explanation Help Please

    Here's an explanation I wrote about a very similar formula.

    http://www.excelforum.com/excel-form...-function.html
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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] I need VBA explanation on this code please help me!!!
    By venkatpvc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-23-2013, 07:38 PM
  2. [SOLVED] Explanation line in code
    By thair in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-18-2012, 10:43 AM
  3. [SOLVED] Code explanation please
    By Geordie in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-15-2012, 08:12 AM
  4. explanation of code
    By leanne2011 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-29-2011, 06:50 PM
  5. Code explanation
    By bajdr47 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-06-2011, 12:30 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