+ Reply to Thread
Results 1 to 38 of 38

How do you provide points based on a defined lookup targets table

  1. #1
    Registered User
    Join Date
    04-04-2014
    Location
    uk
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    15

    How do you provide points based on a defined lookup targets table

    Hi

    I am trying to find a generic way to assign points based on value results, ie I have a columns labeled Test and Test2 with values, and desired results is the Pts in next column which are based on the lookup table (targets)

    Need to lookup by col name in lookup table and then value and incorporate the criteria from lookup table within formula, so if I wanted to change a >= to > this would be automatically handled without hardcoding in the formula, and of course it applies the points from the pts column

    I have tried to use hardcode sumifs with "test" and hardcode the criteria and pts, which does work to a point, but its not generic, and would like to have a generic formula so if I applied to another col it would use the col name to lookup against whats in the lookup table

    This dosent fully work as also need to be bases on key in col A which gives different points based on that aswell.

    And icing on cake would be conditional formatting to work on the column data and points

    Thanks in advance for any help
    Attached Files Attached Files
    Last edited by jpskiller; 07-24-2023 at 01:04 PM. Reason: Add excel example

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,902

    Re: How do you provide points based on a defined lookup targets table

    1. Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file and a mocked up solution.

    2. Are you still using 2010? If not, please update your profile. It can make a big difference in the solutions offered.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    04-04-2014
    Location
    uk
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    15

    Re: How do you provide points based on a defined lookup targets table

    Cheers, I have now added my attempt example!

  4. #4
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,058

    Re: How do you provide points based on a defined lookup targets table

    Try this in C4
    Please Login or Register  to view this content.
    committed with Ctrl+Shift+Enter and copied down, then copied C4:C13 to G4:G13.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-04-2014
    Location
    uk
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    15

    Re: How do you provide points based on a defined lookup targets table

    Quote Originally Posted by windknife View Post
    Try this in C4
    Please Login or Register  to view this content.
    committed with Ctrl+Shift+Enter and copied down, then copied C4:C13 to G4:G13.
    Wow brilliant, that was quick and gave exactly what I wanted, I then added a new Target range and Col called Test3 where I changed the target types from <= to >= and for some reason it doesn't give the correct results, Im not gonna lie I don't fully understand that formula but all the ranges seem to be covered, I uploaded worksheet with the formula in
    Attached Files Attached Files

  6. #6
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: How do you provide points based on a defined lookup targets table

    Another solution:

    The whole column in one go:

    Please empty cells D4:D13 and H4:H13 and try in D4 and copy to H4:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: How do you provide points based on a defined lookup targets table

    where I changed the target types from <= to >= and for some reason it doesn't give the correct results
    Both my formula and Windknife's formula do not take this situation into account, because it was not included in your test set.
    It must be clear which degrees of freedom are possible.

    I don't have time today, but will make a solution for this tomorrow.
    I already know how I want to handle that.

  8. #8
    Registered User
    Join Date
    04-04-2014
    Location
    uk
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    15

    Re: How do you provide points based on a defined lookup targets table

    Quote Originally Posted by HansDouwe View Post
    Both my formula and Windknife's formula do not take this situation into account, because it was not included in your test set.
    It must be clear which degrees of freedom are possible.

    I don't have time today, but will make a solution for this tomorrow.
    I already know how I want to handle that.
    Apologies I wasn't clear about that, really appreciate help so far and must be honest while both formulas are complex, I can follow yours a little more, but I can see what ever is the final working solution is going to require me to do a lot of research understand, which is a good thing

  9. #9
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,058

    Re: How do you provide points based on a defined lookup targets table

    Amended formula in C4

    Please Login or Register  to view this content.
    committed with Ctrl+Shift+Enter
    Attached Files Attached Files

  10. #10
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: How do you provide points based on a defined lookup targets table

    both formulas are complex
    The main reason for this is that you allow several comparison signs at the same time in a table (being a unique combination of test and area).

    This formula works well when the table (being a unique combination of test and area) contains 1 or more times the comparison sign >= in combination with 0 or 1 time <.
    And the formula also works well when the table contains 1 or more of the comparison sign <= in combination with 0 or 1 times >.
    Even when the table is not sorted properly.

    The formula does not work correctly when a table contains more than 2 times the comparison sign > in combination with 0 or 1 time <=.
    This table can always be converted to a table with 1 or more times the comparison sign <= in combination with 0 or 1 time >.
    The formula also does not work properly if a table contains more than 2 times the comparison sign > in combination with 0 or 1 time <=.
    This table can always be converted to a table with 1 or more times the comparison sign >= in combination with 0 or 1 time <.

    Please try in E4 and copy to I4 and M4:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    04-04-2014
    Location
    uk
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    15

    Re: How do you provide points based on a defined lookup targets table

    Thank you this looks great

  12. #12
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: How do you provide points based on a defined lookup targets table

    You are Welcome!
    Thanks for your feedback, Glad to have helped.

    If you haven't already, please consider adding reputation to all helpers you think they deserve.
    In that case please click * Add Reputation left below their answers.

  13. #13
    Registered User
    Join Date
    04-04-2014
    Location
    uk
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    15

    Re: How do you provide points based on a defined lookup targets table

    @HansDouwe

    Hi,

    2 very different solutions, which is great and will require some study to understand as currently beyond my ability

    I added more targets so targets went up to row 33, but when I try and change formula that reference targets row 25 to 33 I get error 'you cannot change part of an array' any idea why that is
    Last edited by AliGW; 07-23-2023 at 07:09 AM. Reason: Please do NOT quote unnecessarily!

  14. #14
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: How do you provide points based on a defined lookup targets table

    My formula isn't written very neatly yet.
    When you adjust the range of the table, you have to do that in 6 places. [Wherever it says 25 now].
    Late tonight.I will upload a formula in which you only have to indicate the range of the table once.
    If another member has not done so yet.

  15. #15
    Forum Contributor
    Join Date
    10-22-2022
    Location
    Santa Cruz, Bolivia
    MS-Off Ver
    MSO 365
    Posts
    149

    Re: How do you provide points based on a defined lookup targets table

    hi everyone, after check the consult I allow to propose another possible solution:

    Please Login or Register  to view this content.
    This formula spill all the results and permits to change the number of "Test" in cell B3 in order to obtain the results of G4:G13 in the same column.

    I hope it results useful.
    Last edited by ExceLogan; 07-23-2023 at 08:58 AM.

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,573

    Re: How do you provide points based on a defined lookup targets table

    @ExcelLogan

    The functions are not in English. See if you can use this to translate the formula, please: https://en.excel-translator.de/translator/

    It would be helpful to attach a workbook, as the formula will be translated there by Excel.

    The lingua franca here is English for posts and formulae.

    Thank you.
    Last edited by AliGW; 07-23-2023 at 07:47 AM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  17. #17
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,902

    Re: How do you provide points based on a defined lookup targets table

    I usually do the row adjustment like this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    assuming there are no blank cells in column D. Pick any fully populated column or use MATCH.

  18. #18
    Registered User
    Join Date
    04-04-2014
    Location
    uk
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    15

    Re: How do you provide points based on a defined lookup targets table

    @ExceLogan

    Are you able to upload workbook with this in so Excel can do the translation please
    Last edited by AliGW; 07-23-2023 at 08:02 AM. Reason: Please do NOT quote unnecessarily!

  19. #19
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,573

    Re: How do you provide points based on a defined lookup targets table

    I had already asked for this in post #16, but I have also contacted ExcelLogan privately to ask them to attach a workbook here.

  20. #20
    Registered User
    Join Date
    04-04-2014
    Location
    uk
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    15

    Re: How do you provide points based on a defined lookup targets table

    Sorry I missed that, now I have seen, and I tried that translate link you provided but could not get results working
    Last edited by AliGW; 07-23-2023 at 08:12 AM. Reason: Please do NOT quote unnecessarily!

  21. #21
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,573

    Re: How do you provide points based on a defined lookup targets table

    No, it's missing TOMAR, which is TAKE, and EXCLUIR - I don't know which function that should be.

    Please don't quote unnecessarily. Thanks.

    =MAP(A4:A13,B4:B13,LAMBDA(a,t,LET(_at,Targets!A2:A17&Targets!B2:B17,_p,XMATCH(a&B3,_at,,-1),_m,EXCLUIR(TAKE(Targets!C2:E17,_p),_p-SUM(--(_at=a&B3))),_Pts,INDEX(_m,,3),IFNA(INDEX(_Pts,XMATCH(10,SUMIF(t,INDEX(_m,,2)&INDEX(_m,,1),_Pts))),))))
    Last edited by AliGW; 07-23-2023 at 08:19 AM.

  22. #22
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,573

    Re: How do you provide points based on a defined lookup targets table

    I've worked it out - EXCLUIR is DROP:

    =MAP(A4:A13,B4:B13,LAMBDA(a,t,LET(_at,Targets!A2:A17&Targets!B2:B17,_p,XMATCH(a&B3,_at,,-1),_m,DROP(TAKE(Targets!C2:E17,_p),_p-SUM(--(_at=a&B3))),_Pts,INDEX(_m,,3),IFNA(INDEX(_Pts,XMATCH(10,SUMIF(t,INDEX(_m,,2)&INDEX(_m,,1),_Pts))),))))

  23. #23
    Registered User
    Join Date
    04-04-2014
    Location
    uk
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    15

    Re: How do you provide points based on a defined lookup targets table

    Thanks, have given it a try but just get #NAME?, be great to see in a working example

  24. #24
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,573

    Re: How do you provide points based on a defined lookup targets table

    If you have the correct version of Excel, you won't get the name error. Works for me.

    Attached so that you can double-check.
    Attached Files Attached Files

  25. #25
    Registered User
    Join Date
    04-04-2014
    Location
    uk
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    15

    Re: How do you provide points based on a defined lookup targets table

    I see, current laptop only has 2016 on, other laptop that has 365 on out of order at min, will try it tomorrow when working

  26. #26
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,573

    Re: How do you provide points based on a defined lookup targets table

    That'll be it, then.

  27. #27
    Forum Contributor
    Join Date
    10-22-2022
    Location
    Santa Cruz, Bolivia
    MS-Off Ver
    MSO 365
    Posts
    149

    Re: How do you provide points based on a defined lookup targets table

    Hi again, my apologies for the miss-translation in my proposal.

    I already changed and translate my post, if someone need to verify it.

  28. #28
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,573

    Re: How do you provide points based on a defined lookup targets table

    Too late - I've already done it for you (post #22).

    In future, please always provide workbooks as well as formulae. Thanks.

  29. #29
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: How do you provide points based on a defined lookup targets table

    In this formula the ranges are defined 1 time at the beginning of the formula, so its easier to adjust the formula, if there are other ranges:

    The range with the tables could be oversized.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  30. #30
    Registered User
    Join Date
    04-04-2014
    Location
    uk
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    15

    Re: How do you provide points based on a defined lookup targets table

    Hi All,

    I would like to thank all who have been involved I have managed to fully test and use @windknife version, I like this as its easier to digest and is also backward compatible.

    I have not fully tested the others yet, had a play with @HansDouwe version which so far seems to work but to me is very complex, I also tried @ExcelLogan version but this seemed to fail on the test 3 variation I posted in 2nd upload.

    However all help if much appreciated.

  31. #31
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,573

    Re: How do you provide points based on a defined lookup targets table

    Glad to have helped.

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

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

  32. #32
    Forum Contributor
    Join Date
    10-22-2022
    Location
    Santa Cruz, Bolivia
    MS-Off Ver
    MSO 365
    Posts
    149

    Re: How do you provide points based on a defined lookup targets table

    hi everyone, I share again my solution proposal that I tested and check to results was correct for the three tests.

    I hope it results useful.

    Points based on Value (Solution).xlsx

  33. #33
    Registered User
    Join Date
    04-04-2014
    Location
    uk
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    15

    Re: How do you provide points based on a defined lookup targets table

    Thank you I will give this further testing over next few days and feedback results

  34. #34
    Registered User
    Join Date
    04-04-2014
    Location
    uk
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    15

    Re: How do you provide points based on a defined lookup targets table

    @ExcelLogan

    I have tested your version and it does work well, I have 1 point, if I was to extend the range so it exceeds what's being targeted,
    i.e. to cover auto data growth, how do you prevent it from putting 0 where either column A is blank
    or the column begin used to target is blank.

    I have attached example

    Thanks

  35. #35
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,573

    Re: How do you provide points based on a defined lookup targets table

    This:

    =MAP($A$4:$A$100,$B$4:$B$100,LAMBDA(a,t,LET(_at,Targets!$A$2:$A$33&Targets!$B$2:$B$33,_p,XMATCH(a&$B$3,_at,,-1),_m,DROP(TAKE(Targets!$C$2:$E$33,_p),_p-SUM(--(_at=a&$B$3))),_Pts,INDEX(_m,,3),IFNA(INDEX(_Pts,XMATCH(10,SUMIF(t,INDEX(_m,,2)&INDEX(_m,,1),_Pts))),""))))

  36. #36
    Registered User
    Join Date
    04-04-2014
    Location
    uk
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    15

    Re: How do you provide points based on a defined lookup targets table

    Thank you, I don't seem to be able to give any reputation to @ExcelLogan, I have been able to with others and yourself

  37. #37
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,573

    Re: How do you provide points based on a defined lookup targets table

    Are you getting a message telling you to spread the rep before repping him again? If so, there's your answer. It's a security measure to prevent people from mutually repping each other to artificially increase their rep count (yes, it has happened!).

  38. #38
    Registered User
    Join Date
    04-04-2014
    Location
    uk
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    15

    Re: How do you provide points based on a defined lookup targets table

    Cheers, sorted now

+ 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. Lookup and provide latest price for month based criteria
    By jw01 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-16-2022, 02:42 PM
  2. Replies: 1
    Last Post: 09-19-2021, 08:29 PM
  3. Replies: 2
    Last Post: 01-29-2021, 12:11 PM
  4. Lookup 2 data points then into a table to find the the relevant cell
    By king10001 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-15-2019, 08:20 AM
  5. [SOLVED] Provide user defined function for below vba code
    By tanmanoj in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-29-2013, 12:10 AM
  6. Table based on defined name, change defined name, how?
    By Dubrock in forum Excel General
    Replies: 0
    Last Post: 06-27-2012, 09:20 AM
  7. Issues converting a race points lookup table
    By 450nick in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-10-2009, 12:09 PM

Tags for this Thread

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