+ Reply to Thread
Results 1 to 8 of 8

Custom Equations built off Index Match

  1. #1
    Registered User
    Join Date
    08-09-2021
    Location
    Washington DC, USA
    MS-Off Ver
    2019
    Posts
    3

    Custom Equations built off Index Match

    Hi,

    By all means I am no VBA expert. But I have been tasked with trying to figure this out. My goal here is to make custom equations like =unit_count() that will return the unit count based off of the two letter code contained in the referenced cell. The attached contains the two letter codes and in subsequent column headers, the values I seek to create custom equations for.

    Can anyone start me off in the right direction?


    Thanks
    -C
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    05-15-2017
    Location
    US
    MS-Off Ver
    365
    Posts
    901

    Re: Custom Equations built off Index Match

    Based on the few samples, would Index/Match work for you?

    try this
    Please Login or Register  to view this content.
    If you find the suggestion or solution helpful, please consider adding reputation to the post.

  3. #3
    Registered User
    Join Date
    08-09-2021
    Location
    Washington DC, USA
    MS-Off Ver
    2019
    Posts
    3

    Re: Custom Equations built off Index Match

    Unfortunately no. That wouldn't work. I'm trying to write a UDF that would allow me to input =property_name(A1) and have it return the full property name based off of the p-code inputted into A1. The idea is to have these UDFs be usable on any spreadsheet on my (or anothers) computer.

    Appreciate the response though!

  4. #4
    Valued Forum Contributor
    Join Date
    05-15-2017
    Location
    US
    MS-Off Ver
    365
    Posts
    901

    Re: Custom Equations built off Index Match

    I didnt realize you needed a UDF, so here you go

    Please Login or Register  to view this content.
    You can use it like this in the sheet

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-09-2021
    Location
    Washington DC, USA
    MS-Off Ver
    2019
    Posts
    3

    Re: Custom Equations built off Index Match

    hey! Much appreciated. But still not what I'm going for here. Hoping to get something that just requires one input.

    I just want an equation that'll run an index match on this original spreadsheet and return a value on whatever spreadsheet I put the equation on. So like, the test toolbox sheet tells you that the unit count for AG is 200. Assuming I get a spreadsheet from a 3rd party that does not include that information but does include the p-code AG, I want to be able to insert an =unitcount() on that cell and have it return me the unit count on that 3rd party provided spreadsheet.

    I need to study more :I

  6. #6
    Valued Forum Contributor
    Join Date
    05-15-2017
    Location
    US
    MS-Off Ver
    365
    Posts
    901

    Re: Custom Equations built off Index Match

    If you only want it to expect one value, will the ranges for the lookup and return array always be the same?

    If so then you can remove those parameters and hard code them in the function, so that the index/match still gets what i needs to work, but the user is only providing the lookup value.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Custom Equations built off Index Match

    cdon61,
    This will return the matched value where;
    L4 = Header name that has search value.
    L5 = Search value.
    M4 = Header name that has return value.

    So if you change "address_property" to "unit_count" in M4, you will get 200.
    Use in cell like

    =IndexIf(A1:I4,L4,L5,M4)

    Please Login or Register  to view this content.

  8. #8
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Custom Equations built off Index Match

    This formula works. In N5

    =IFERROR(INDEX($C:$C,AGGREGATE(15,6,ROW($C$2:$C$4)/(($A$2:$A$4=UPPER(L5))*($D$2:$D$4=M5)),1)),"")
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

+ 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] Index, Match, left and middle equations
    By zeez36 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-01-2020, 07:34 AM
  2. showing parameters on custom built functions
    By justin4480 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-17-2008, 02:41 AM
  3. Displaying data in a custom built user form
    By thomas.szwed in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-19-2007, 05:28 PM
  4. built-in custom chart types
    By Daniel in forum Excel General
    Replies: 0
    Last Post: 08-20-2006, 02:25 PM
  5. [SOLVED] Custom function to simplify Index(match)) formula
    By Martin in forum Excel General
    Replies: 0
    Last Post: 03-20-2006, 10:50 AM
  6. [SOLVED] Activate Built-in chart in Custom Types tab
    By Lisa in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 03-16-2006, 07:55 PM
  7. Using SUM with a custom built range
    By Floyd in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-11-2005, 02:06 AM

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