+ Reply to Thread
Results 1 to 15 of 15

Match 4 Worksheets & 1 flag cell to get respective values

  1. #1
    Forum Contributor
    Join Date
    10-18-2019
    Location
    Mumbai
    MS-Off Ver
    OFFICE 2010
    Posts
    427

    Post Match 4 Worksheets & 1 flag cell to get respective values

    My data is in 4 Worksheets: Sheet1, Sheet2, Sheet3 & Sheet4

    Each Worksheet has 2 ranges: B2:B6 & D2:D6. B2:B6 are values which are alphabets & D2:D6 contains numerical values.
    Also there is a ‘flag cell’ in each Worksheet at B10 which is either of >=0

    Formula requested for H2:H6 in Sheet4 as:

    ‘Grab’ D2:D6 values from the Worksheet by matching B2:B6 respectively where B10=1
    If any of B10 is not equal to 1, then “” in H2:H6 in Sheet4.
    If no match is found then “” in the respective H2:H6 in Sheet4.

    How to accomplish please?
    Attached Files Attached Files

  2. #2
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Match 4 Worksheets & 1 flag cell to get respective values

    Better if you can change the sheet name according B10 cell.

    Then try

    H2=IFERROR(VLOOKUP(B2,INDIRECT("'"&$B$10&"'!B:D"),3,0),"")

    Copy down
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  3. #3
    Forum Contributor
    Join Date
    10-18-2019
    Location
    Mumbai
    MS-Off Ver
    OFFICE 2010
    Posts
    427

    Re: Match 4 Worksheets & 1 flag cell to get respective values

    Quote Originally Posted by shukla.ankur281190 View Post

    Then try
    Could not understand what to do with your formula…..which portion of your formula needs to be edited to match my situation?
    Is the formula checking all 4 Worksheets cell B10 =1?
    Please re-build your formula completely.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Match 4 Worksheets & 1 flag cell to get respective values

    With a Named Range (List - CTRL-F3 to view edit) and a list of sheets in L1 to L4, this array formula in H2, copied down:

    =IFERROR(OFFSET(INDIRECT("'"&INDEX(List,MATCH(TRUE,COUNTIF(INDIRECT("'"&List&"'!B10"),1)>0,0))&"'!D2"),ROWS($1:1)-1,,,),"")

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  5. #5
    Forum Contributor
    Join Date
    10-18-2019
    Location
    Mumbai
    MS-Off Ver
    OFFICE 2010
    Posts
    427

    Re: Match 4 Worksheets & 1 flag cell to get respective values

    Quote Originally Posted by Glenn Kennedy View Post
    With a Named Range (List - CTRL-F3 to view edit) and a list of sheets in L1 to L4, this array formula in H2, copied down:
    This was extremely well thought through. A great mix of practical skills and theory, with just the right level of knowledge to keep things exact…..thanks Glenn; your formula works perfectly well

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Match 4 Worksheets & 1 flag cell to get respective values

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

  7. #7
    Forum Contributor
    Join Date
    10-18-2019
    Location
    Mumbai
    MS-Off Ver
    OFFICE 2010
    Posts
    427

    Re: Match 4 Worksheets & 1 flag cell to get respective values

    Quote Originally Posted by Glenn Kennedy View Post
    You're welcome.
    My actual Worksheet tab named are 11, 12, 13, 14 instead of Sheet1, Sheet2, Sheet3 & Sheet4
    Instead of D2:D6 it is C2:C6 and instead of B10 it is D47

    I had re-phrased your formula as
    =IFERROR(OFFSET(INDIRECT("'"&INDEX(List,MATCH(TRUE,COUNTIF(INDIRECT("'"&List&"'!D47"),1)>0,0))&"'!C2"),ROWS($1:1)-1,,,),"")

    but not getting the result. Where am I making mistake?

    I have attached replica of the original file. Unable to get the results in AA2:AA6 using your formula. Where am I making mistake?

    plus

    the formula should get corresponding values of column C from the ‘resultant’ Worksheet (‘resultant’ Worksheet: Worksheet in which D47 is found equal to 1) after Matching column A of Worksheet (tab named 14) with column A of the ‘resultant’ Worksheet.

    Please help
    Attached Files Attached Files
    Last edited by bittubadri; 12-08-2019 at 08:49 PM.

  8. #8
    Forum Contributor
    Join Date
    10-18-2019
    Location
    Mumbai
    MS-Off Ver
    OFFICE 2010
    Posts
    427

    Re: Match 4 Worksheets & 1 flag cell to get respective values

    Quote Originally Posted by Glenn Kennedy View Post
    You're welcome.
    My thread is unsolved. I tried using your formula but could not get the desired results in AA2:AA6 of Worksheet with tab named 14 when replicated your formula in my own Workbook.

    The required formula in AA2:AA6 in Worksheet with tab named 14 should get corresponding values of column C out of the 4 Worksheets in which D47 is found equal to 1 after Matching column A of Worksheet with tab named 14 with column A of the ‘resultant’ Worksheet ((‘resultant’ Worksheet: Worksheet in which D47 is found equal to 1)

    I have attached the Workbook for your kind perusal please.

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Match 4 Worksheets & 1 flag cell to get respective values

    You forgot to enter the formula as an array. See explanation at Post 4.

  10. #10
    Forum Contributor
    Join Date
    10-18-2019
    Location
    Mumbai
    MS-Off Ver
    OFFICE 2010
    Posts
    427

    Re: Match 4 Worksheets & 1 flag cell to get respective values

    Quote Originally Posted by Glenn Kennedy View Post
    You forgot to enter the formula as an array.
    My mistake. Thanks Glenn

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Match 4 Worksheets & 1 flag cell to get respective values

    No problem!!!

  12. #12
    Forum Contributor
    Join Date
    10-18-2019
    Location
    Mumbai
    MS-Off Ver
    OFFICE 2010
    Posts
    427

    Re: Match 4 Worksheets & 1 flag cell to get respective values

    Quote Originally Posted by Glenn Kennedy View Post
    No problem!!!
    The formula is not performing INDEX/MATCH i.e. the formula should get corresponding values of column C, out of the 4 Worksheets in which D47 is found equal to 1, after Matching column A of the Worksheet with tab named 14 with the column A of the ‘resultant’ Worksheet.

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Match 4 Worksheets & 1 flag cell to get respective values

    You are right. it does not do that. In all your samples (including this one) the naems were in the same order in every sheet. There was no mention anywhere that they could be in a different order. Now they are. I have randomised them and matched them:

    =IFERROR(INDEX(INDIRECT("'"&INDEX(List,MATCH(TRUE,COUNTIF(INDIRECT("'"&List&"'!D47"),1)>0,0))&"'!C2:C7"),MATCH(A2,INDIRECT("'"&INDEX(List,MATCH(TRUE,COUNTIF(INDIRECT("'"&List&"'!D47"),1)>0,0))&"'!A2:A7"),0)),"")

    Don't forget to enter as an array!!
    Attached Files Attached Files

  14. #14
    Forum Contributor
    Join Date
    10-18-2019
    Location
    Mumbai
    MS-Off Ver
    OFFICE 2010
    Posts
    427

    Re: Match 4 Worksheets & 1 flag cell to get respective values

    Quote Originally Posted by Glenn Kennedy View Post
    I have randomised them and matched them:
    Awesome. Your help is a balm to all who encounter it. Thanks Glenn, it works.

  15. #15
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Match 4 Worksheets & 1 flag cell to get respective values

    LoL. You're welcome!!

+ 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. Replies: 5
    Last Post: 07-04-2019, 08:14 AM
  2. using VBA to calculate input from one cell to the respective values further down.
    By andreasnw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-10-2017, 07:21 AM
  3. how to split data into different worksheet
    By fluffyvampirekitten in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-28-2015, 04:37 AM
  4. [SOLVED] VBA help need to highlight the cells based on the dates and insert respective cell values.
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-24-2014, 11:14 PM
  5. [SOLVED] Enter a value to change other cell values to match that throughout multiple worksheets
    By swiftworks in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 01-14-2013, 05:30 PM
  6. [SOLVED] Calling multiple macros based on respective cell values
    By yg65 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-27-2012, 08:51 PM
  7. Flag row if cell values = something specific
    By Some Dude in forum Excel General
    Replies: 5
    Last Post: 05-24-2006, 08:45 AM

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