+ Reply to Thread
Results 1 to 8 of 8

formula to obtain next value in row?

  1. #1
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    formula to obtain next value in row?

    hello

    i need a formula that will show me the next value in the row if the lookup name is the same.

    for example, the name 3HM occurs i.e. 30 times but they have different values in each row. once the user selects it from drop down in cell B2, then the cells in C5:C12 (red cells), should change accordingly.

    the data should change with the numbers found in the "Data" sheet column i.e. AO.

    i have attached a sample...thank you!

    essentially, vlookup only grabs the first match of #s regardless of how many times it is located....but i want a formula to show the different values....hope it makes sense.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: formula to obtain next value in row?

    any thoughts on this guys?

  3. #3
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: formula to obtain next value in row?

    Vlookup works only with unique values.
    3HM is not unique.
    You have to do a addition to make it unique
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  4. #4
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: formula to obtain next value in row?

    Quote Originally Posted by popipipo View Post
    Vlookup works only with unique values.
    3HM is not unique.
    You have to do a addition to make it unique
    yes, i am aware of this .....i know there is a formula index, small etc but not sure how to compute that...thanks.

  5. #5
    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
    52,929

    Re: formula to obtain next value in row?

    Looking at your data...how is excel supposed to know that you want the 1st...or 3rd...or 20th instance of that selection? Excel sees a criteria, and finds stuff based on that. If you can create a unique ID for each for each instance, then you can use that to pull in the different values. Maybe something like =C9&COUNTIF($C$9:C9,C9)
    This will give you 3HM1, 3HM2, 3HM3 etc for each type
    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

  6. #6
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: formula to obtain next value in row?

    hi jw01. it's not impossible, like FDibbins mentioned, but isn't it torturing to you or the user to pick the the nth selection? if you insist, you can do this array formula in C5:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    otherwise, another alternative is naming those validation list properly. those with repeated values will have a number tagged to them. for eg, somewhere in Calc Graph row 66, put in:
    =IF(COUNTIF($B$66:$B$1256,B66)>1,B66&"_"&COUNTIF(B$66:B66,B66),B66)

    copy down. copy this range of values & Paste Special -> Values into B66 onwards. so 3HM will become 3HM_1, 3HM_2, & so on. those with no repeats will turn up like the original. with that, the formula in C5 can be:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  7. #7
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: formula to obtain next value in row?

    Quote Originally Posted by benishiryo View Post
    hi jw01. it's not impossible, like FDibbins mentioned, but isn't it torturing to you or the user to pick the the nth selection? if you insist, you can do this array formula in C5:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    otherwise, another alternative is naming those validation list properly. those with repeated values will have a number tagged to them. for eg, somewhere in Calc Graph row 66, put in:
    =IF(COUNTIF($B$66:$B$1256,B66)>1,B66&"_"&COUNTIF(B$66:B66,B66),B66)

    copy down. copy this range of values & Paste Special -> Values into B66 onwards. so 3HM will become 3HM_1, 3HM_2, & so on. those with no repeats will turn up like the original. with that, the formula in C5 can be:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    hey there

    the first formula works amazing...thank you so, so much!

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: formula to obtain next value in row?

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. Formula to obtain different rows between ranges
    By cgkmal in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-21-2013, 05:40 PM
  2. obtain the text from a formula
    By jtwork in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-12-2008, 05:25 AM
  3. Obtain formula value in VBA
    By jimmmmyj in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-04-2007, 08:48 AM
  4. [SOLVED] formula to obtain difference between two dates.
    By Onkar Raut in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-19-2006, 03:40 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