+ Reply to Thread
Results 1 to 8 of 8

Create own formula to replace VLOOKUP or INDEX & MATCH

  1. #1
    Registered User
    Join Date
    04-01-2017
    Location
    Brussels, Belgium
    MS-Off Ver
    2010
    Posts
    3

    Create own formula to replace VLOOKUP or INDEX & MATCH

    Hi guys,

    I'm currently working in the Finance Controlling department for a large Fortune 500 company.
    In this role, I often create budget overviews for my business partners.
    Our financial system only provides me with an overview per cost center (a part of an organization to which costs may be charged for accounting purposes), but not per Budget name and/or budget owner.
    This is why I rely on one single underlying mapping table to link a cost center to a budget name and budget owner.

    I currently use INDEX & MATCH to link the two together.
    I do this multiple times per day and although it's a relatively efficient formula, I'm looking for a way to create my own formula to replace INDEX/MATCH to help me save time.

    In practice, I want to create a formula called BudgetOwner, that automatically returns "Frank Underwood", when I refer to cost center "USA001" (see mapping table below)
    So in essence, BudgetOwner(A1) = "Frank Underwood"

    Can anyone help me out with the coding?
    The mapping sheet is stored on a central location, so ideally I would have Excel consult the mapping table in that location, so that any changes/updates to the mapping are picked up automatically.

    A greatly simplified version of the mapping table is shown below.

    Cost Center Budget name Budget owner
    USA001 Sales Frank Underwood
    USA002 Sales Frank Underwood
    USA004 Marketing Tom Johnson
    USA005 Sales Frank Underwood
    USA006 Marketing Tom Johnson
    USA007 Marketing Tom Johnson

    I've been exploring the functionalities of PowerPivot as well, but it's not exactly what I'm looking for.

    Thanks a lot for your help on this!

    Br,

    Kris
    Attached Files Attached Files
    Last edited by KriswithaK; 04-01-2017 at 04:11 AM.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,199

    Re: Create own formula to replace VLOOKUP or INDEX & MATCH

    Attach a sample workbook.

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on REPLY then GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Registered User
    Join Date
    04-01-2017
    Location
    Brussels, Belgium
    MS-Off Ver
    2010
    Posts
    3

    Re: Create own formula to replace VLOOKUP or INDEX & MATCH

    Thanks John. I've added a sample workbook to show what I'm looking for. Just let me know if not clear.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,199

    Re: Create own formula to replace VLOOKUP or INDEX & MATCH

    Curious as to how replacing one formula with another saves time (?).

    Put this in E2 and copy down as far as you want ...


    =IFERROR(INDEX(Mapping!$A:$C,MATCH('RAW FINANCIAL DATA'!$A2,Mapping!$A:$A,0),MATCH('RAW FINANCIAL DATA'!E$1,Mapping!$A$1:$C$1,0)),"")

    Now enter data in column A


    No more entries required !!!

  5. #5
    Registered User
    Join Date
    04-01-2017
    Location
    Brussels, Belgium
    MS-Off Ver
    2010
    Posts
    3

    Re: Create own formula to replace VLOOKUP or INDEX & MATCH

    Thanks John. I probably wasn't clear in my request....
    I want to create my own formula that I can use in every future workbook that automatically does the lookup for me.
    So rather than doing the entire INDEX & MATCH (including flipping back and forth between the sheets to select the correct ranges & cells), I want my formula (Budgetowner) to automatically return the budgetowner whenever I refer to the cost center.
    So BudgetOwner(USA001), would automatically give me "Frank Underwood".
    I'm just not sure how I would need to setup the coding in VBA.

    This will save me time as I won't have to, import the mapping sheet, define my ranges and select the cells every single time I create a new sheet from scratch.

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

    Re: Create own formula to replace VLOOKUP or INDEX & MATCH

    Are you looking for a VBA solution, then?
    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.

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,199

    Re: Create own formula to replace VLOOKUP or INDEX & MATCH

    Still not sure (convinced)

    I created named range "Cost_Centre" based on A2:C9 in "Mapping" This could be made dynamic if there are more cost centres)

    in F2

    =IERROR(VLOOKUP(A2,Cost_Center,3,0),"")

    in E2 (Budget Name)

    =VLOOKUP($A2,Cost_Center,2,0)


    No different to adding

    =BudgetOwner(A2)

    where "BudgetOwner" is a UDF

  8. #8
    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,434

    Re: Create own formula to replace VLOOKUP or INDEX & MATCH

    Unless the order of the mapping table changes, I don't see the point of a two way match/index. The VLOOKUP is a more convenient approach. And a dynamic named range makes it simpler.

    If you put it in VBA, you'll need to maintain code and the workbook will need to be macro enabled.
    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


+ 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. How to create a countif index match formula
    By MZing81 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-22-2016, 04:38 PM
  2. [SOLVED] using Index match in replace of vlookup
    By srinivasan1965 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-23-2016, 07:58 AM
  3. [SOLVED] How to replace VLOOKUP with INDEX and MATCH
    By jackson_hollon in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-06-2014, 04:38 PM
  4. Trying to create an if index match formula of some sort
    By Sivalensis in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-03-2014, 11:27 AM
  5. [SOLVED] index match array formula - replace cell references with ranges
    By nigelog in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-17-2014, 10:39 AM
  6. Replies: 4
    Last Post: 01-13-2014, 04:16 AM
  7. A macro to replace Index and Match formula
    By namcheang in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-05-2013, 08:08 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