VLOOKUP to Find the Last Value in a List

Поделиться
HTML-код
  • Опубликовано: 5 окт 2024
  • Learn more incredible Excel Formulas - bit.ly/Ultimat...
    Use VLOOKUP to return the last match in a list. The VLOOKUP function is brilliant, but it has its limitations.
    One of these is that the VLOOKUP function can only find the first value in a list. This is great when you are looking for unique values, but not when the value occurs multiple times in a list.
    This video tutorial shows how to use VLOOKUP to find the last value in a list.
    In the video, the COUNTIF function is used to find how many times the lookup value occurs. It is also used to create a column of unique values.
    View 5 alternative reasons to use the COUNTIF function
    • 5 Alternative Reasons ...
    The VLOOKUP function is then used on the column of unique values.
    Find more great free tutorials at;
    www.computerga...
    ** Online Excel Courses **
    The Ultimate Excel Course - Learn Everything ► bit.ly/Ultimat...
    Excel VBA for Beginners ► bit.ly/37XSKfZ
    Advanced Excel Tricks ► bit.ly/3CGCm3M
    Excel Formulas Made Easy ► bit.ly/2ujtOAN
    Creating Sports League Tables and Tournaments in Excel ► bit.ly/2Siivkm
    Connect with us!
    LinkedIn ► / 18737946
    Instagram ► / computergaga1
    Twitter ► / computergaga1

Комментарии • 97

  • @OHatef
    @OHatef 2 года назад

    After going through alotta forums and even the excel's official site and lots of tutorial and only getting some basic stuff, at last i found what i wanted here, Respect

  • @mafiosol_buenavida
    @mafiosol_buenavida 5 лет назад +1

    This is brilliant and a useful yet logical alternative to the lookup method.

  • @wilfredocabuenas
    @wilfredocabuenas 4 года назад

    I applied this formula to find the last payment date of the customer in a big data, it works. Thank you!

    • @Computergaga
      @Computergaga  4 года назад

      Fantastic! Happy to help Wilfredo.

  • @nguyenthanhmy1702
    @nguyenthanhmy1702 5 лет назад +2

    Learn from your vids, applied to my job. Thank you so much

  • @itwturner
    @itwturner 5 лет назад +1

    I have been trying to figure this out for years. Thanks!

  • @wayneedmondson1065
    @wayneedmondson1065 6 лет назад +1

    Hi Alan.. excellent.. had not thought of your method to solve this problem. So simple, yet so clever. Outstanding! Thumbs up!

  • @mp_petrov
    @mp_petrov 2 года назад

    Thanks for your help, it makes sense to create a unique identifier and work with that.

    • @Computergaga
      @Computergaga  2 года назад +1

      You're welcome. Thank you Martin.

    • @mp_petrov
      @mp_petrov 2 года назад

      @@Computergaga When I started tackling this issue, I was shocked to find that you cannot directly apply sort to the range parameter within the vlookup formula and basically sort it in desc, then get the first occurrence (the last before sorting). Ot at least that was my initial idea.

    • @Computergaga
      @Computergaga  2 года назад +1

      For sure. In Excel 365 the XLOOKUP and XMATCH functions offer a search last-to-first option. There is also a SORT function that can be used. But prior to that version, there are no built-in function options.

  • @vickymadhas
    @vickymadhas 5 лет назад

    Thank You very much. Finally can do it for my business sheet. 2 days I searching this solution and finally I get your video with smart and simple logic

  • @arfason
    @arfason 7 лет назад +1

    Thanks very easy and helpful !

  • @cedricwright4122
    @cedricwright4122 8 лет назад +1

    Thanks. Keep they coming.

  • @raja83154
    @raja83154 Год назад

    It's very amazing idea . Thanks

  • @rbrtktl
    @rbrtktl 5 лет назад +1

    Gr8 Idea. Helped me today. Thanks...

  • @wahabrajiwate6181
    @wahabrajiwate6181 7 лет назад +1

    Nice trick, can you avoid helper column and show the same, may be with index and match pls.

    • @Computergaga
      @Computergaga  7 лет назад

      Thanks Wahab. Not sure about avoiding the helper column because the lookup functions will want something physical to look in.
      An INDEX and MATCH version could look like this - =INDEX(F:F,MATCH(I4&J1,D:D,0))

  • @knzamy
    @knzamy 5 лет назад

    this is what i'm looking for..thanks mate!

  • @retro1333
    @retro1333 3 года назад

    Ty for the help.

  • @davidtostenson4083
    @davidtostenson4083 3 года назад

    Is there a way to do this on a table? Every time I add a new row there is an unwanted cell target shift that doesn't match what would happen if I was to drag the function down. Any ideas?

  • @MrLbott
    @MrLbott 6 лет назад +1

    Good work... and well explained. 🖒

  • @rnpk9572
    @rnpk9572 5 лет назад +1

    Great Job ! thank you very much sir.

    • @Computergaga
      @Computergaga  5 лет назад

      Thank you.

    • @rnpk9572
      @rnpk9572 5 лет назад

      still looking for one situation...in column a repeated apple 5 times in column b subsequently 12345
      now i am looking to bring the last entered value from column b that is 5
      seeking your help in this regards. thanks

    • @Computergaga
      @Computergaga  5 лет назад

      Sounds like you may need another helper column. A repeat of the process in this video for the 5's. So that you can receive the last of the 5's.

  • @davidreynolds9118
    @davidreynolds9118 3 года назад +1

    Another interesting way to do this would be with a maxifs rather than countif, then all you would need in the helper column would be a series on numbers from 1 to k. Then use the formula = VLOOKUP(MAXIFS(HelperColumn,Criteia column, Criteria),Table_Array,Col_Index,FALSE)

    • @lmtz007
      @lmtz007 Год назад

      Please could you show me how to do it? I need to extract the latest value from a huge list from certain part numbers, I don't want to introduce every time a value to concatenate and bla bla bla... thank you.

  • @prabhakarverma8854
    @prabhakarverma8854 4 года назад

    very smart thinking

  • @truyencaothe1945
    @truyencaothe1945 5 лет назад

    Nice work, very smart way. Thank a lot mate!

  • @deannaarrants9713
    @deannaarrants9713 4 года назад

    You are my hero!!! Thank you!!!

  • @ivirensha
    @ivirensha 2 года назад

    Thank you Sir 😊

  • @GopalBiswas-wt5ef
    @GopalBiswas-wt5ef Год назад

    before the last payment date and amount show in excel

  • @busta0079
    @busta0079 5 лет назад

    hi, great video. can you retrieve the sum of the last 5?

    • @Computergaga
      @Computergaga  5 лет назад

      VLOOKUP can't. But we could use 5 VLOOKUPs each to return the last 5. Then sum them.

  • @श्रीबागेश्वरमहादेवमन्दिरनारनोल

    THANKS SIR

  • @rahman24434
    @rahman24434 8 месяцев назад

    Thanks ❤

  • @jay55patel
    @jay55patel 7 лет назад +1

    thank you good job

  • @julylahera
    @julylahera 5 лет назад

    It is great thanks! is it possible to find the value previous the last one? I would like to calculate the difference between the last 2 numbers, and i don't want to update the formula every week :)

    • @Computergaga
      @Computergaga  5 лет назад +1

      Sure. Cell J1 has been used in the formula for the total number of matches. You could have another cell such as K1 with =J1-1 and this will be the second from last value.
      Then do two VLOOKUPs, one from the video - one finding the K1 value. Job done!

  • @securityinvestigator2095
    @securityinvestigator2095 3 месяца назад

    What if I want to find the max value for a customer id and not the last value

    • @Computergaga
      @Computergaga  3 месяца назад

      You want the MAXIFS function

  • @itsvatsa
    @itsvatsa 4 года назад

    hi there, how does this change if the sorting changes, I i still need the last / latest date?

    • @Computergaga
      @Computergaga  4 года назад

      The sorting would ruin it. A better approach is required. You could uase the FILTER function, Power Query or if you are returning a number SUMIFS is maybe easiest.

  • @georgemaragos2378
    @georgemaragos2378 4 года назад

    Hi. Great video, i actually used it to sort a problem.
    But then decided it was to complex in formula for me to give to others at work to do each week.
    Then one night i got a idea
    Export all data from Myob as csv
    Import into excel ( 40,000 transactions )
    Sort 2 ways Firstly by Product code, then second level sort Date Newest to oldest
    Then copy of of the main data part number and paste into new column, then highlight new column and remove duplicated ( multiple sales )
    From this new smaller list of catalog part numbers i do a vlookup by part number and jump across 3 colums to the unit sales price
    This gives me the last purchase price because the file is sorted by part number first then by date with newest on the top - so vlookup now gives me the first match as it does and it is the latest price sold - what i was looking for
    I do use your formula for other items, first price, last price , second last price, then combine a sumif for the average - good for seeing patterns in products or reps.
    Thanks for sharing a useful solution
    Regards
    George

    • @Computergaga
      @Computergaga  4 года назад

      You're welcome George. Nice work.

  • @Toxic_-_James
    @Toxic_-_James 4 года назад

    Hi, thanks for the video it's really useful. Quick question for you though, when creating the helper column it is hardcoded to C2&COUNTIF($C$2:C2,C2), is there a way to create this using table referencing?
    It would be something like [@Customer ID]&COUNTIF($C$2:[@Customer ID],[@Customer ID]), but i don't know how to make an absolute reference to cell C2, the first row in the column, using "table referencing".
    I like to try to remove all hardcoding if possible.

  • @CozzyHadjineophytou
    @CozzyHadjineophytou 6 лет назад

    You might be able to do it by sorting at 2 levels: Customer ID small to large and then Order ID large to small. Give it a try and tell me if it works

  • @Bashir_Kano
    @Bashir_Kano Год назад

    Pls can we nest the same process to Index Match that replaces Vlookup?

    • @Computergaga
      @Computergaga  Год назад +1

      Sure. If VLOOKUP can do it, so can INDEX MATCH

    • @Bashir_Kano
      @Bashir_Kano Год назад

      @@Computergaga Thank you so much.

  • @cooxncooxn3738
    @cooxncooxn3738 7 месяцев назад

    every body needs reverse Vlookup , but ms havent given yet. please ms give us RVlookup :)

  • @pinoydad299
    @pinoydad299 7 лет назад

    HOW TO DO CONDITIONAL FORMATING
    WHEN MET THE CONDITION IT SHOWS THE CHECK ICON.

    • @Computergaga
      @Computergaga  7 лет назад

      Highlight the values that you want to test. Click Conditional Formatting and then New Rule. Change the Two Colour Scale option to Icon Sets and then select the check icon from the list provided. You then set the criteria.
      This defaults to looking at values as percentages. You probably want to change the Type column to Number and then set the criteria.

  • @majidsiddique8227
    @majidsiddique8227 5 лет назад

    Excellent

  • @ExcelExpert25390
    @ExcelExpert25390 6 лет назад

    Hats off bro i want same with thing with index match could you plz suggest me any video for that

    • @Computergaga
      @Computergaga  6 лет назад +1

      I don't have a video on INDEX and MATCH to fetch the last item, although I do have a INDEX-MATCH video.
      An INDEX and MATCH alternative for this video would be =INDEX(F:F,MATCH(I4&J1,D:D,0))

    • @ExcelExpert25390
      @ExcelExpert25390 6 лет назад

      thank you soo much bro it's working give me one more favor, i have multiple criteria suppose if i have date as 2nd lookup value then what should be my formula is????

    • @Computergaga
      @Computergaga  6 лет назад

      The easiest way is to create a new concatenated column of the 2 criteria i.e. name and date. Then use the INDEX and MATCH or VLOOKUP to look down that column for the concatenated lookup value.
      I have a video here showing what I mean with VLOOKUP searching for firstname and lastname - ruclips.net/video/ZqWTsmk2Jk8/видео.html

  • @amitkumar-ip6yv
    @amitkumar-ip6yv 7 лет назад +1

    nice trick

  • @jcornia82931
    @jcornia82931 5 лет назад

    I need to find the last payment made on a purchase order in a list that runs the payments horizontally in Excel, there is only one line item per PO with the months running across the top of the worksheet. I figured out how many payments have been made and I believe I have to use the Hlookup vs the Vlookup but I'm not sure. Can anyone help!?

    • @Computergaga
      @Computergaga  4 года назад

      Sure you can do the same approach but with a HLOOKUP for the row.

  • @pinoydad299
    @pinoydad299 7 лет назад

    how show if the result value on the last column if is not a number?

    • @Computergaga
      @Computergaga  7 лет назад

      This technique works for text also. It does not rely on being numeric to count occurrences or to concatenate the number after the value and then look it up.
      Thanks for your comment Robert.

    • @pinoydad299
      @pinoydad299 7 лет назад +1

      thanks ..

  • @wisnuwibowo5352
    @wisnuwibowo5352 6 лет назад

    sorry sir, i'm not good in english, Why your formula not running well if we want to take data from another sheet, or folder, i hope you understand what i mean.

    • @Computergaga
      @Computergaga  6 лет назад

      The same can be applied to data on another sheet. As for the folder you would need to import the data into a worksheet first, being using this formula.

    • @wisnuwibowo5352
      @wisnuwibowo5352 6 лет назад

      @@Computergaga ok Sir Thanks a lot, well done, running well if in one work sheet (Subscribe and thumb up done)

  • @arindambhattacharya8127
    @arindambhattacharya8127 2 года назад

    you can count when you have 18 lines and put that count to vlook up. I have 18,000 lines..do I write another formula to count? Not a feasible formula..max function should work

    • @Computergaga
      @Computergaga  2 года назад

      Depends on the data as to whether max would work. Another option is XLOOKUP if you have Excel 365. That can look from bottom up.

  • @Dev_Bartwal
    @Dev_Bartwal 6 лет назад +1

    Great

  • @mathijs9365
    @mathijs9365 4 года назад

    Just sort descending on date.
    Count function uses a lot of memory when you have ten thousends of rows

    • @Computergaga
      @Computergaga  4 года назад

      It doesn't use that much. But anyhow we are looking for a specific ID so for your results we would also need to filter for that and then when we are finished maybe reset the filter and the sort. And the formula provides an automated solution for reports and other outputs.
      But yes there are numerous other ways we can get the answer for this task. Each with their pros and cons.

  • @derekporter66
    @derekporter66 8 лет назад +1

    animal. keep them coming