+ Reply to Thread
Results 1 to 11 of 11

Identify and store a custom parameter into a LET function

  1. #1
    Registered User
    Join Date
    10-28-2019
    Location
    Brussels, Belgium
    MS-Off Ver
    Office 365
    Posts
    21

    Identify and store a custom parameter into a LET function

    Hi everyone,

    I have two main columns in my file that I want to use:

    "F ID" - a column with IDs;
    "S DP" - a column with either numerical values or "Not correct value" as text;

    I have a function that does other things, which are un-related to my current question, on column "H" (progress until now). What I want to do is add to this function a range that finds the first occurrence of a numerical value on column "S DP", for each F ID, and stores it in the LET function for later use.

    My current LET function:

    =LET(NOT_CORRECT,"Not correct value",

    count_ROWS,ROWS('DP & PAC'!$B$2:$B$7424)+2,

    table_RANGE_YEAR,C2:INDEX(C:C,count_ROWS),
    table_RANGE_SUBMITTED_DP,D2:INDEX(D:D,count_ROWS),
    table_RANGE_INVESTMENT,F2:INDEX(F:F,count_ROWS),
    table_RANGE_FUNDRAISING,E2:INDEX(E:E,count_ROWS),
    table_RANGE_FundID,B2:INDEX(B:B,count_ROWS),


    MIN_YEAR,MIN(table_RANGE_YEAR),
    MAX_YEAR,MAX(table_RANGE_YEAR),

    table_RANGE_OFFSET_INVESTMENT,OFFSET(table_RANGE_INVESTMENT,1,0),
    table_RANGE_OFFSET_FUNDRAISING,OFFSET(table_RANGE_FUNDRAISING,1,0),


    table_RANGE_INV_AMT_INV_PER_YEAR, IF( table_RANGE_YEAR = MIN_YEAR, table_RANGE_INVESTMENT, (table_RANGE_INVESTMENT - table_RANGE_OFFSET_INVESTMENT)),
    table_RANGE_FR_AMT_RAISED_PER_YEAR, IF( table_RANGE_YEAR = MIN_YEAR, table_RANGE_FUNDRAISING, (table_RANGE_FUNDRAISING - table_RANGE_OFFSET_FUNDRAISING)),



    table_RANGE_FR_AMT_RAISED_PER_YEAR)



    ---------------------

    Does someone know a solution for this? i've added a few end-results manually on the "manual input" column, with the desired outcome of the function.

    Many thanks!!
    S
    Attached Files Attached Files

  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
    48,136

    Re: Identify and store a custom parameter into a LET function

    Maybe this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by TMS; 09-26-2022 at 06:59 PM. Reason: Correct formula - add FALSE parameter
    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
    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
    48,136

    Re: Identify and store a custom parameter into a LET function

    This lists the IDs and most recent values:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by TMS; 09-26-2022 at 06:58 PM. Reason: Correct formula - add FALSE parameter

  4. #4
    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
    48,136

    Re: Identify and store a custom parameter into a LET function

    Or this, using your variables:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by TMS; 09-26-2022 at 06:57 PM. Reason: Correct formula - add FALSE parameter

  5. #5
    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
    48,136

    Re: Identify and store a custom parameter into a LET function

    I was bemused that my formula looked right but, instead of returning zero for the first ID, it returned a value. I investigated and realised that I had missed a parameter (FALSE) from the MATCH function.

    some corrected examples

    List IDs and values
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    List values
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    List values using OP's variables
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Column H Formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    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
    48,136

    Re: Identify and store a custom parameter into a LET function

    Is this resolved to your satisfaction?



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  7. #7
    Registered User
    Join Date
    10-28-2019
    Location
    Brussels, Belgium
    MS-Off Ver
    Office 365
    Posts
    21

    Re: Identify and store a custom parameter into a LET function

    Very interesting solution, thank you for this! I like it.

    Is there a way for which "S_DP" returns two columns, one being the F ID and the other being the first amount on column D (as in your current formula result)?

    I used the filter function you provided & coupled it with a VLOOKUP in order to end up with one value per F ID - theoretically the first value it finds, but for some reason it brings up exactly the first value it finds from the bottom - instead of the first value from the top.

    Do you know why this is?

    Here is my result based on your filter formula, with VLOOKUP that brings almost what I want to bring, however it brings the first result from the bottom instead of from the top:

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    10-28-2019
    Location
    Brussels, Belgium
    MS-Off Ver
    Office 365
    Posts
    21

    Re: Identify and store a custom parameter into a LET function

    Also used this from what you suggested, but as a last step I;m trying to get "S_DP" to show F ID as well instead of just the values:


    Please Login or Register  to view this content.

  9. #9
    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
    48,136

    Re: Identify and store a custom parameter into a LET function

    The first formula in post #5 does what you want.

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

  10. #10
    Registered User
    Join Date
    10-28-2019
    Location
    Brussels, Belgium
    MS-Off Ver
    Office 365
    Posts
    21

    Re: Identify and store a custom parameter into a LET function

    Perfect, thank you very much, I must have missed it due to tiredness!

    I'll mark it as solution and close the thread.

  11. #11
    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
    48,136

    Re: Identify and store a custom parameter into a LET function

    You're welcome. Thanks for the rep.

+ 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. Power query Custom function / parameter query
    By Dicken in forum Office 365
    Replies: 0
    Last Post: 03-23-2022, 10:41 AM
  2. [SOLVED] Power Query Custom Column to identify First Occurrence of Data
    By ibuhary in forum Excel General
    Replies: 18
    Last Post: 12-16-2019, 11:46 AM
  3. [SOLVED] Identify the last sale orders for each store
    By Ucpaul in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-28-2013, 02:34 AM
  4. Looking for a way to identify and store different strings
    By tryer in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-17-2011, 08:24 AM
  5. Identify a custom menu control
    By pprseller in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-31-2009, 01:04 PM
  6. How to store custom data into Excel cell
    By Popovic.Sasa@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2006, 08:30 AM
  7. Format when sending a range as parameter to a custom function
    By George Furnell in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-01-2005, 01:25 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