+ Reply to Thread
Results 1 to 8 of 8

Trying to find a source segment of a formula

  1. #1
    Forum Contributor Marvo's Avatar
    Join Date
    01-15-2009
    Location
    Northampton, England
    MS-Off Ver
    Excel 2021
    Posts
    990

    Trying to find a source segment of a formula

    I'm trying to dissect the following formula to better understand. Where can I find the information for s and t please? Its not in name manager.

    =LET(t,ALL!$K:$K,s,SEQUENCE(ROWS(t)),MAX(FREQUENCY(IF(t="W",s),IF(t<>"W",s))))

    Thanks.
    Last edited by Marvo; 03-27-2024 at 08:59 AM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: Trying to find a source segment of a formula

    =LET(t,ALL!$K:$K,s,SEQUENCE(ROWS(t)),MAX(FREQUENCY(IF(t="W",s),IF(t<>"W",s))))

    T is defined by the bit in red and s by the bit in blue.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Contributor Marvo's Avatar
    Join Date
    01-15-2009
    Location
    Northampton, England
    MS-Off Ver
    Excel 2021
    Posts
    990

    Re: Trying to find a source segment of a formula

    So the idea is once you've written it once, you don't have to write it again?

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: Trying to find a source segment of a formula

    If you think of =LET() as being a bucket, it's easier to understand. It doesn't of itself, actually do ANYTHING.

    LET will keep various sub-formulae for convenient (multiple) re-use in the main formula. In your case, there are to subformulae, t & s. Instead of calculating them every time (which then gets slow) they are calculated once and each of them is used twice in the final formula. =LET() enable more complex functions to be calculated with greater efficiency.

  5. #5
    Forum Contributor Marvo's Avatar
    Join Date
    01-15-2009
    Location
    Northampton, England
    MS-Off Ver
    Excel 2021
    Posts
    990

    Re: Trying to find a source segment of a formula

    Thank you Glenn, I think I understand.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: Trying to find a source segment of a formula

    Finally, in these longer and longer formulae, I tend to put all the bits of the raw data that I need IMMEDIATELY after LET... to make it easier to adjust ranges, if needed. They're all there (and only there) at the start of the formula.

  7. #7
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,870

    Re: Trying to find a source segment of a formula

    In my words, the start of a LET clause sets various parameters that you go on to use in a formula.

    So, for example, consider this:

    =IF(COUNTIF(A:A,"Marvo")>1,"Happy Days",COUNTIF(A:A,"Marvo"))

    which could be condensed to:

    =LET(c,COUNTIF(A:A,"Marvo"),hd,"Happy Days",IF(c>1,hd,c))

    You can give your parameters (almost) any name you like.
    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.

  8. #8
    Forum Contributor Marvo's Avatar
    Join Date
    01-15-2009
    Location
    Northampton, England
    MS-Off Ver
    Excel 2021
    Posts
    990

    Re: Trying to find a source segment of a formula

    Thank you Ali. I get it 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. [SOLVED] Need VBA to find Demerits code from different code segment
    By astray88 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-14-2023, 04:48 AM
  2. Need vba code to find acc keys from bulk segment data
    By henrybrothers in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-21-2023, 07:40 PM
  3. [SOLVED] Formula Using Ranks for a Column Segment
    By redrocker12 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-23-2022, 01:51 PM
  4. [SOLVED] How find source of formula it means formula applied on which cells
    By keshavtale in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-03-2019, 09:17 AM
  5. [SOLVED] Can't find source of formula (hidden worksheet)
    By soooty in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-10-2019, 07:58 AM
  6. [SOLVED] Formula to lookup company/segment name based on dynamic values
    By 198four in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-28-2018, 10:28 PM
  7. How change link source in long formula when source moved
    By Irina in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-28-2006, 02:30 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