+ Reply to Thread
Results 1 to 14 of 14

Find First Number Within Two Ranges

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Find First Number Within Two Ranges

    In cells YR3 to ABS3 there may be numbers (they might all be empty but if there is data it'll be a number). Let's call this range "H". The same applies for ABT3 to AEU3 but we'll call this range "A". That is 80 cells for each of those ranges.

    In cell ES4 I need a formula that looks for the first bit of data across both these ranges and when found pastes the number it finds and whether it was found in range "H" or range "A".

    So if there is '3' in cell YZ3 but there is a '5' in ABU3 then cell ES4 should return 'A5'. This is because the first instance of data was found in the 'A' range and the actual number found was '5'.
    Last edited by ScabbyDog; 01-22-2016 at 11:53 AM. Reason: Mod Required me to do so

  2. #2
    Forum Contributor
    Join Date
    08-25-2015
    Location
    Near Pittsburgh, PA
    MS-Off Ver
    Excel 2013
    Posts
    152

    Re: Find First Help

    I may be confused - it seems as though you are not consistent in your range names, from Paragraph 1 vs Paragraph 3 (Range A vs Range H).

    I'm not able to think of a formula to do this, though. Maybe a macro?

  3. #3
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Find First Help

    YR3 to ABS3 can be called range 'H'

    ABT3 to AEU3 can be called range 'A'

    Perhaps I may need a macro. I'll post my question on the VBA forum.
    Last edited by ScabbyDog; 01-22-2016 at 11:40 AM.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,051

    Re: Find First Help

    Quote Originally Posted by ScabbyDog View Post
    Perhaps I may need a macro. I'll post my question on the VBA forum.
    No, please do not post duplicate threads, it goes against our rules. If you need to move this thread, let a mod or admin know
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    607

    Re: Find First Help

    no posting?

    Edit: for some reason I keep getting access denied...trying again

    This seems awfully long but it does seem to work, if I've read the question right that is

    ok..fine...it seems to think my formula is html.

    I'll add my test file instead.
    Attached Files Attached Files
    Last edited by Beamernsw; 01-22-2016 at 11:43 AM.

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Find First Help

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  7. #7
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    607

    Re: Find First Help

    Yes, sorry newdoverman, I was going to mention that to ScabbyDog myself and forgot... was going to suggest something like "Find first number within 2 ranges" or something along those lines.

  8. #8
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Find First Help

    Perfect Beamernsw! Super work.

  9. #9
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    607

    Re: Find First Number Within Two Ranges

    I'm glad I could help.....but please do change the Post Title so others can search for this thread and get answers as well.

  10. #10
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    607

    Re: Find First Number Within Two Ranges

    I think a good title that might yield search results could be: "Find first occurrence of number within multiple ranges"

  11. #11
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Find First Number Within Two Ranges

    This is a bit late but you might want to consider it.
    Enter this in ES4
    Formula: copy to clipboard
    =IFERROR("H"&INDEX(YR3:ABS3,MATCH(TRUE,YR3:ABS3<>"",0)),"A"&INDEX(ABT3:AEU3,MATCH(TRUE,ABT3:AEU3<>"",0)))

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

  12. #12
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Find First Number Within Two Ranges

    Quote Originally Posted by newdoverman View Post
    This is a bit late but you might want to consider it.
    Enter this in ES4
    Formula: copy to clipboard
    =IFERROR("H"&INDEX(YR3:ABS3,MATCH(TRUE,YR3:ABS3<>"",0)),"A"&INDEX(ABT3:AEU3,MATCH(TRUE,ABT3:AEU3<>"",0)))

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    This works great BUT it needs to know what the first number found is. So if for example if there is '3' in cell YZ3 but there is a '5' in ABU3 then cell ES4 should return 'A5'. This is because the first instance of data was found in the 'A' range and the actual number found was '5'.

    I've had to re-open this as I've been trying to use Beamersnw's code in a macro but since it's more than 255 characters it's having trouble running it so I need a solution that is 255 characters or less!

  13. #13
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Find First Number Within Two Ranges

    This will return the values that you specify if entered in the cells that you mention. This was simply a reversal of the terms of the formula
    Formula: copy to clipboard
    =IFERROR("A"&INDEX(ABT3:AEU3,MATCH(TRUE,ABT3:AEU3<>"",0)),"H"&INDEX(YR3:ABS3,MATCH(TRUE,YR3:ABS3<>"",0)))

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

  14. #14
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Find First Number Within Two Ranges

    Quote Originally Posted by newdoverman View Post
    This will return the values that you specify if entered in the cells that you mention. This was simply a reversal of the terms of the formula
    Formula: copy to clipboard
    =IFERROR("A"&INDEX(ABT3:AEU3,MATCH(TRUE,ABT3:AEU3<>"",0)),"H"&INDEX(YR3:ABS3,MATCH(TRUE,YR3:ABS3<>"",0)))

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Thanks but I'm in the same situation then if the first number is found in the other range. The formula will need to know which range the first number is found in.

+ 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: 3
    Last Post: 08-18-2015, 09:04 AM
  2. Replies: 9
    Last Post: 12-21-2014, 06:29 PM
  3. Replies: 1
    Last Post: 12-17-2012, 08:00 PM
  4. Replies: 4
    Last Post: 09-18-2012, 10:54 AM
  5. Find Macro With Userform - To find a data across multiple tabs in excel
    By Testify in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 03-15-2012, 04:49 PM
  6. [SOLVED] Despite data existing in Excel 2002 spreadsheet Find doesn't find
    By AnnieB in forum Excel General
    Replies: 1
    Last Post: 06-15-2006, 09:15 PM
  7. Replies: 1
    Last Post: 01-31-2006, 06:25 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