+ Reply to Thread
Results 1 to 7 of 7

Finding most-often (frequency) works or gives REF error

  1. #1
    Forum Contributor
    Join Date
    04-03-2009
    Location
    Anchorage, Alaska, USA
    MS-Off Ver
    Office 365
    Posts
    113

    Finding most-often (frequency) works or gives REF error

    Hi,

    I'm stumped. Am I missing something, or is there a glitch in Excel?

    Basically, these two formulas are the same. They just point to different lists, meaning different columns. One points to the LOCATION column. For the other points to the LEAD column. Other than that they are the same.

    One works, one does not.

    ENTER THE ACCOUNT NUMBER IN CELL E2.
    The formulas point to E2 during calculation.

    This works: I'll call it the LOCATION formula since it returns a city name
    Cell F3:
    Please Login or Register  to view this content.
    This does not work. I'll call it the LEAD formula since it returns a salesperson's name
    Cell F4:
    Please Login or Register  to view this content.
    Screenshot 2023-07-13 232206.png

    Why?

    A little background on the formula:
    • The formula has 4 parts to it
    • X counts the number of instances the account number appears in the list - that is, column A.
    • Y executes an INDEX/MODE/MATCH thing to find the most frequent item, be it pointing to the LOCTION or LEAD column. INDEX/MODE/MATCH only works with more than 1 instance. Hence, the COUNTIFS to determine the number of instances of the account number are in column A.
    • I found Y at Exceljet
    • Z performs a simple XLOOKUP if only one instance is found since XLOOKUP works like that.
    • The formula if X>1 then Y else Z allows for flow.

    Spreadsheet attached.

    Thanks.
    Attached Files Attached Files

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

    Re: Finding most-often (frequency) works or gives REF error

    Try this,

    E2
    Please Login or Register  to view this content.
    F2
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    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,064

    Re: Finding most-often (frequency) works or gives REF error

    An alternative - (delete BOTH current results) - gets both in one formula.

    =TRANSPOSE(BYCOL(B2:C27,LAMBDA(z,LET(a,FILTER(z,A2:A27=E2),u,UNIQUE(a),TAKE(SORTBY(u,MAP(u,LAMBDA(c,SUM(N(a=c)))),-1),1)))))
    Attached Files Attached Files
    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

  4. #4
    Forum Contributor
    Join Date
    04-03-2009
    Location
    Anchorage, Alaska, USA
    MS-Off Ver
    Office 365
    Posts
    113

    Re: Finding most-often (frequency) works or gives REF error

    Windknife, you're saying I needed to restate the FILTER sections in order for this to work, like so...

    Attachment 836442

    Thank you. That makes sense. And I see why you added the additional variable in order to keep from repeating the FILTER section.

  5. #5
    Forum Contributor
    Join Date
    04-03-2009
    Location
    Anchorage, Alaska, USA
    MS-Off Ver
    Office 365
    Posts
    113

    Re: Finding most-often (frequency) works or gives REF error

    Glenn. That is a flex! Like a HAL9000 flex.

    I dont even know what I'm looking at here.

    And it works. That's just awesome.

    I'll unpack your bit of spellwork when I can.

    Thank you for the insight on what's available in Excel.

  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,064

    Re: Finding most-often (frequency) works or gives REF error

    You're welcome. If you try to figure it out... and get stuck... just ask.

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

    Re: Finding most-often (frequency) works or gives REF error

    You are welcome.

+ 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. finding the frequency of patterns in data set
    By fatterthanelvis in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-27-2016, 08:28 AM
  2. [SOLVED] .Match with On Error: On Error Resume Next works. On Error GoTo only works once. Err.Clear
    By Doc.AElstein in forum Excel - New Users/Basics
    Replies: 28
    Last Post: 03-16-2015, 12:55 PM
  3. keep getting "debug error" [solved]
    By ferday in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-11-2015, 03:26 PM
  4. Finding Frequency for Data
    By AppleMonster in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-06-2014, 01:20 PM
  5. Finding Frequency of data
    By kavin in forum Excel General
    Replies: 3
    Last Post: 09-10-2012, 10:41 AM
  6. Simulation frequency divider works almost right
    By Errwin in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-29-2009, 04:18 AM
  7. Finding frequency
    By mac_see in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-27-2005, 03:06 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