+ Reply to Thread
Results 1 to 14 of 14

Checking Different {Lookup_Ranges} if Missing from one Lookup Range..!!!

  1. #1
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Checking Different {Lookup_Ranges} if Missing from one Lookup Range..!!!

    Checking Different {Lookup_Ranges} if Missing from one Lookup Range..!!!

    Dear Forum,

    I know of getting the adjacent values based on a Lookup Value from a Lookup Range using VLOOKUP,HLOOKUP,INDEX,MATCH Function combinations..
    However, We can only provide a single Lookup Range to the Function's Parameters...
    In a situation where if the Lokkup_Value does not exist in any particular Range, then we want the Search to be carried from another LookUp_Range how would we do it..

    I know we can use several IF's to get the result but it fails if the No of Lookup_Ranges are more than 7 ..
    Presently, I have to lookout for Single Alphabets Value given in a Group..

    A I J Q Y - 1 , Now as seen this group of Alphabets are given a value of 1 and now if I need to search for the Alphabet A I need to get the answer as 1 , however if the Alphabet would have been any other than the one given in the Gruop then it wil give a #N/A ERROR...But I have another group B K R - 2 so If the Letter is not from the First Group then it should then search in the Second Group and give the answer 2 for the Alphabet K...

    This is an Anology, I would also like to check between several Sheets using the same approach if possible..

    Please find the attachment..

    Warm Regards
    e4excel
    Attached Files Attached Files
    Last edited by e4excel; 02-09-2012 at 09:59 AM.

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

    Re: Checking Different {Lookup_Ranges} if Missing from one Lookup Range..!!!

    Let's put this formula in C2, then copy down:

    =VLOOKUP("*" & B2 & "*", $I$2:$J$9, 2, 0)
    _________________
    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!)

  3. #3
    Valued Forum Contributor
    Join Date
    12-05-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010 & 2013
    Posts
    308

    Re: Checking Different {Lookup_Ranges} if Missing from one Lookup Range..!!!

    Hi e4excel

    Try this in Cell C2:

    Please Login or Register  to view this content.
    It assumes each value in column B only appears once.

    Cheers, Rob.

  4. #4
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Checking Different {Lookup_Ranges} if Missing from one Lookup Range..!!!

    Wow..That WOrks Great in Both cases..!
    Great Solutions JB & RCS..

    Never thought that it will work with a Simple Wild Card VLOOKUP...
    RCS _ I love the SUMPRODUCT approach however I could never come up with that..

    This is an Anology, I would also like to check between several Sheets using the same approach if possible..
    Is the above possible if the Alphabets group would be in Different Sheets...

    Warm Regards
    e4excel

  5. #5
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Checking Different {Lookup_Ranges} if Missing from one Lookup Range..!!!

    Dear Forum,

    Just need to check incase if the Data is spread in different sheets as this will be more closer to the actual work..!

    Please find the same file with some changes but with the Alphabets Group Data in different Sheets..

    Hope this is possible..!

    Warm Regards
    e4excel
    Attached Files Attached Files

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

    Re: Checking Different {Lookup_Ranges} if Missing from one Lookup Range..!!!

    It's at points like these when I stop my clients "creativity" and instruct them to manage the organization of their workbook, do not let the workbook manage you.

    Create a single sheet wherein you can store this table properly. Use it from there. Let your workbook grow from a better starting point, don't keep programming around prior chaotic decisions. Fix them.

  7. #7
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Checking Different {Lookup_Ranges} if Missing from one Lookup Range..!!!

    Dear JB,

    Point Noted and totally agree...
    However, In certain scenarios if you need to check for a particular client when the Transaction for different clients are entered in Different Sheets and also on different Rows with the only good thing is that the data is in the same Columns as all the Sheets for the Months would have the same structure..

    I am actually working on getting the Inputs for Various Clients from different Sheets and this Template was not deisgned by me..

    I would have thought of consolidation however till a New System is made it will still be entered in the Seperate Monthly SHeets...and therefore consolidation is also not a good option..

    Though what you suggest is of utmost importance more than pondering on retrieving the data in different ways its always good to have a good deisgn..

    Warm Regards
    e4excel
    Last edited by e4excel; 02-08-2012 at 06:57 AM.

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

    Re: Checking Different {Lookup_Ranges} if Missing from one Lookup Range..!!!

    See if you can apply this 3D VLOOKUP trick...

    '3D VLOOKUP (& HYPERLINK)
    Here's a page showing a formula method doing a VLOOKUP across multiple worksheets. The formula will return the answer from the first sheet that has the searched value. There's a sample file as well.


    3D VLOOKUP() and HYPERLINK()

  9. #9
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Checking Different {Lookup_Ranges} if Missing from one Lookup Range..!!!

    Thanks a lot JB...!

    That works and you actually helped me unravel something really interesting ...
    Just feel like got a JackPot..
    I just modified that formula with your WIldCard Addition and it works absolutely the way it should..

    Just out of Curiosity I am asking though this query is finally SOLVED...

    Was the same possible using SUMPRODUCT FUNCTION ?

    I had done a small course in C Programming some 12 years back which helped in understanding the Loops or Iterations...!
    In my head I was thinking that if we could have some kind of 2 intertwining FOR loops..

    Warm Regards
    e4excel

  10. #10
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Checking Different {Lookup_Ranges} if Missing from one Lookup Range..!!!

    Dear JB,

    The only Problem I face with this specific requirement is that it gives me the very First Column Heading Row instead of the actual one after using the Absolute Columns..I:J

    PHP Code: 
    =VLOOKUP("*"&B2&"*"INDIRECT("'" INDEX(ShtRng, MATCH(1COUNTIF(INDIRECT("'" ShtRng &"'!I2:I10"), "*"&B2&"*"), 0)) & "'!I:J"), 20
    Actually I wanted to avoid even the Row Numbers...too I2:I10..

    Now, is there a way of actually getting the Max Filled Row for both or single Columns I & J so that I could use that instead of an explicit number as the number of FIlled Rows in the Sheets may vary..

    Warm Regards
    e4excel

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

    Re: Checking Different {Lookup_Ranges} if Missing from one Lookup Range..!!!

    There's a limit to my personal tolerance for complexity. I find readability a plus.

    The INDIRECT() method is already a pain to read and manage, I would resist trying to make the "cell range string" self adjusting, too, the formula could become horrid beyond reason.

    The method does require the "cells evaluated" be the same on every sheet. My recommendation is to simply use a range in that string sufficient to cover looking over the most number of rows to cover the longest likely dataset, and no more.

  12. #12
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Checking Different {Lookup_Ranges} if Missing from one Lookup Range..!!!

    Dear JB,

    Thanks for the help once again I found the Link you created very useful and would get to learn from it a lot..

    REgarding this last query, I just read your response after I posted a new query for getting the Max Filled Row No..

    Warm REgards
    e4excel

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

    Re: Checking Different {Lookup_Ranges} if Missing from one Lookup Range..!!!

    What do you mean?

  14. #14
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Checking Different {Lookup_Ranges} if Missing from one Lookup Range..!!!

    I meant that I started a new query to get the MAX,MIN and Last Filled Row No
    http://www.excelforum.com/excel-work...me-format.html

    but this one is already SOLVED...

    Thanks
    Last edited by e4excel; 02-10-2012 at 02:45 AM.

+ 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