+ Reply to Thread
Results 1 to 8 of 8

Formula to obtain different rows between ranges

  1. #1
    Forum Contributor
    Join Date
    06-07-2011
    Location
    Hnd
    MS-Off Ver
    Excel 2010
    Posts
    161

    Formula to obtain different rows between ranges

    Hi everyone,

    Maybe some expert in formulas could help me with this complex formula for me.

    I want to compare row by row the range A1:D7 with H1:K7 and print begin in A9 the rows of A1:D7 that are different
    and corresponding values of column G for each different row.

    In attached file I show in color the values that I would like to get.

    Any help would be very appreaciated.
    Attached Files Attached Files

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

    Re: Formula to obtain different rows between ranges

    Hello Ckgmal what criteria you want to match from other column as per your data sheet i think you are trying to match only first names that is available in B9. If this is the case you can use =INDEX($G$2:$G$6,MATCH($B9,$H$2:$H$6,0)) in A9.


    If this helps click" * " from bottom left corner of my post

  3. #3
    Forum Contributor
    Join Date
    12-22-2010
    Location
    Rio, Brazil
    MS-Off Ver
    Excel 2010, 2016
    Posts
    209

    Re: Formula to obtain different rows between ranges

    Hi,

    What version of Excel are you using?
    Marcelo Branco

  4. #4
    Forum Contributor
    Join Date
    06-07-2011
    Location
    Hnd
    MS-Off Ver
    Excel 2010
    Posts
    161

    Re: Formula to obtain different rows between ranges

    Hello hemesh and Marcelo,

    Thanks for the help. I'm using Excel 2007 and 2010.

    Actually what I would like in the output is as follow:
    Please Login or Register  to view this content.
    So, the output, beginning in A9 would be:
    32 Jordan Rone 3 2000
    91 Sanchez Guzzler 2250
    Belcher 8 2000
    I hope make sense and could be able to get with a array formula.

    Thanks for the help.

  5. #5
    Forum Contributor
    Join Date
    12-22-2010
    Location
    Rio, Brazil
    MS-Off Ver
    Excel 2010, 2016
    Posts
    209

    Re: Formula to obtain different rows between ranges

    Try this

    1st step
    Put this array formula in B9

    =IFERROR(INDEX(A:A,SMALL(IF(COUNTIFS($H:$H,$A$2:$A$7,$I:$I,$B$2:$B$7,$J:$J,$C$2:$C$7,$K:$K,$D$2:$D$7)=0,ROW(A$2:A$7)),ROWS(B$9:B9))),"")
    confirmed with Ctrl+Shift+Enter, not just Enter

    copy (drag) across to E9 and down

    2nd step
    Put this regular formula in A9

    =IFERROR(INDEX($G:$G,MATCH($B9,H:H,0)),"")
    confirmed with just Enter

    copy down


    Remark: to get rid of 0 (zeros) you can use Custom format [=0]""

    Hope this helps

  6. #6
    Forum Contributor
    Join Date
    06-07-2011
    Location
    Hnd
    MS-Off Ver
    Excel 2010
    Posts
    161

    Re: Formula to obtain different rows between ranges

    Hello Marcelo,

    Thank you for the help, it works.

    Do you think that the result of this formula can be stored in a variable within a VBA macro? or due to is needed to drag across and down
    is not possible to store it in a variable?

    PS: I didn't understanf where to put custom format to get rid of "0s", within the formula?

    Thanks again.

  7. #7
    Forum Contributor
    Join Date
    12-22-2010
    Location
    Rio, Brazil
    MS-Off Ver
    Excel 2010, 2016
    Posts
    209

    Re: Formula to obtain different rows between ranges

    Quote Originally Posted by cgkmal View Post
    Hello Marcelo,

    Thank you for the help, it works.

    Do you think that the result of this formula can be stored in a variable within a VBA macro? or due to is needed to drag across and down
    is not possible to store it in a variable?

    PS: I didn't understanf where to put custom format to get rid of "0s", within the formula?

    Thanks again.
    A VBA macro is another problem but I *think* that, yes, it's possible. You can turn on the macro recorder, do all the process manually (enter the formulas; drag etc etc); turn off the macro recorder and see (adapt) the code.

    About the Custom Format
    Select the range B9:E11; right-click and pick Format Cells...
    In the tab Numbers pick Custom and in the box enter
    [=0]""
    OK

  8. #8
    Forum Contributor
    Join Date
    06-07-2011
    Location
    Hnd
    MS-Off Ver
    Excel 2010
    Posts
    161

    Re: Formula to obtain different rows between ranges

    Thank you Marcelo,

    I've able to get rid of zeros with your suggestion.

    Evaluating the formula step by step I see that the formula returns a value for each cell, but is possible in some way that the result
    of the formula be an array?

    So evaluating the formula step by step the result be shown something like this:
    Please Login or Register  to view this content.
    Thanks for the help again

+ 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] Trying to obtain the maximum value of only certain rows
    By Milkman00 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-01-2013, 02:08 PM
  2. obtain specific rows and column from access table
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-18-2010, 07:44 AM
  3. obtain the text from a formula
    By jtwork in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-12-2008, 05:25 AM
  4. Obtain formula value in VBA
    By jimmmmyj in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-04-2007, 08:48 AM
  5. VBA to obtain Max Rows in any column in Used Reange
    By donoteventry;removes;[email protected] in forum Excel General
    Replies: 4
    Last Post: 07-24-2006, 08: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