+ Reply to Thread
Results 1 to 4 of 4

Need help in re-formulating the codes

  1. #1
    Forum Contributor wedzmer's Avatar
    Join Date
    06-13-2014
    Location
    Philippines
    MS-Off Ver
    2016
    Posts
    422

    Need help in re-formulating the codes

    Hello everyone,

    I would just like to ask help if there's any way where this code below

    =IF(ISERROR(INDEX('MY SF1.xls'!$A$7:$A$2063,LARGE(INDEX(('MY SF1.xls'!$G$7:$G$2063="M")*ROW(INDIRECT("1:"&ROWS('MY SF1.xls'!$G$7:$G$2063))),0),COUNTIF('MY SF1.xls'!$G$7:$G$2063,"M")-ROWS(B$11:B11)+1))),"",INDEX('MY SF1.xls'!$A$7:$A$2063,LARGE(INDEX(('MY SF1.xls'!$G$7:$G$2063="M")*ROW(INDIRECT("1:"&ROWS('MY SF1.xls'!$G$7:$G$2063))),0),COUNTIF('MY SF1.xls'!$G$7:$G$2063,"M")-ROWS(B$11:B11)+1)))
    would be re-edited to a simpler code (or possible vba code). The code's original intent and function is to:

    1. Fetch the value of a certain cell if it fits the condition found on a cell of the same row.
    2. Copies/Fetches the value if it meets that condition successively without skipping rows.

    thanks a lot

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Need help in re-formulating the codes

    From your description it would appear that you are wanting to grab a subset of data from a larger population.
    In which case I'd suggest you use one of the filtering methods, i.e. an Autofilter or Advanced Filter to identify the data and then copy the filtered records to wherever you want them.

    This can typically be achieved with a single line of macro code.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor wedzmer's Avatar
    Join Date
    06-13-2014
    Location
    Philippines
    MS-Off Ver
    2016
    Posts
    422

    Re: Need help in re-formulating the codes

    Hello Richard,


    Yes, that is basically the idea. The code automatically identifies if the specified cell on that particular row meets the condition (which is "M") then copies it and/or proceeds to the next row and so on and so fort.

    The problem I have is that the formula above is quite long and hoping someone could re-edit it for me in a way where its function isn't compromised.

    As for your suggestion on filtering through macro codes, I'm not good at it at all.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Need help in re-formulating the codes

    Hi,

    Upload the workbook, or a representative cut down copy of the workbook and explain in a note which cells you are wanting to copy and where you want them pasted.

+ 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. Formulating Data
    By Mazzaaa in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-16-2016, 06:21 AM
  2. Formulating by dates
    By ConorL in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-24-2013, 09:54 AM
  3. Formulating Data
    By mr.phil in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-24-2013, 05:27 PM
  4. Formulating Textboxes
    By seatownz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-14-2012, 08:00 PM
  5. need help formulating
    By duhbiyung in forum Excel General
    Replies: 1
    Last Post: 04-13-2011, 09:48 PM
  6. formulating Max Lookup(?)
    By DMBFan41 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-21-2007, 06:24 PM
  7. Need help on formulating ordering
    By Angela in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-07-2005, 04:05 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