Results 1 to 8 of 8

Thread: Match And Index Formula To Lookup Data From Table

  1. #1
    Junior Member
    Join Date
    Sep 2012
    Posts
    9
    Rep Power
    0

    Match And Index Formula To Lookup Data From Table

    In column A, I have account numbers like, 850032, 840055, 862212 etc. and column B house amount. I have a table containing, 5 rows, in that, the first column has account numbers, like in the main table, and second column says, the percentage. I want a formula in the column C of main table, that matches the account numbers and then multiply the amount by the percentage of lookup table's corresponding cell.
    Lookup table

    % to be allocated to Operating exp % to be allocated to Maintenance exp Maintenance account
    856001 73% 27% 863
    853000 68% 32% 864
    857000 70% 30% 865
    850001 80% 20% 861
    859000 80% 20% 867

    Also, as it can be seen the last column has 863, 864, 865 etc. in another column say, column D, I want a formula that matches the account numbers and replace the first 3 digits by the corresponding digits.
    So, 856001 will become 863001, 853000 will become 864000 and so on.
    Here is a small part of the main table.


    SAP_Account Amount
    8500005 4,529.49
    8500005 5,500.10
    8500005 12,096.11
    8500100 132.08
    8500121 445.00
    8500203 78.84
    8500211 153.99
    8500231 128.35
    8500232 1,045.70
    8500271 750.00
    8500275 533.95
    8500308 63,528.95

    Thanks

  2. #2
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Hi

    in C2

    =SUMIF($I$2:$I$13,A2,$J$2:$J$13)*B2

    In D2

    =(D2&MID(A2,4,10))+0

    where;

    $I$2:$I$13 = SAP_Account
    $J$2:$J$13 = Amount
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  3. #3
    Junior Member
    Join Date
    Sep 2012
    Posts
    9
    Rep Power
    0
    Thank you very much. I will that now.

  4. #4
    Junior Member
    Join Date
    Sep 2012
    Posts
    9
    Rep Power
    0
    Thank you, the formula is excellent, but I just realized that we match only fiest 3 digits of both matchings. How can I add =left(A2,3) function, so that it matches first 3 digit on both sides.

    Thanks again.

  5. #5
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    =SUMPRODUCT((LEFT($I$2:$I$13,3)=LEFT(A5,3))*$J$2:$ J$13)*B5
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  6. #6
    Junior Member
    Join Date
    Sep 2012
    Posts
    9
    Rep Power
    0
    Thank you very much.The formula is excellent, easy to understand and working great.
    Can I also get the other formula Please, that would replace the first three digits as it described in my original question.
    that if the first 3 digits match then replace as it is in short table.

    Thanks again.
    Last edited by srizki; 07-26-2013 at 12:47 AM.

  7. #7
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Quote Originally Posted by srizki View Post
    Can I also get the other formula Please, that would replace the first three digits as it described in my original question.
    that if the first 3 digits match then replace as it is in short table.

    Thanks again.
    See my second formula.
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  8. #8
    Junior Member
    Join Date
    Sep 2012
    Posts
    9
    Rep Power
    0
    Okay, Thanks

    But how would your second formula know that what should replace, it needs to match before, right?
    % to be allocated to Operating exp % to be allocated to Maintenance exp Maintenance account
    8560001 13% 27% 863
    8530000 18% 32% 864
    8570000 70% 30% 865
    8500001 10% 20% 861
    8590000 10% 20% 867

    so, the formula should find for example 856 and then replace first three to 863.
    Last edited by srizki; 07-26-2013 at 07:14 PM.

Similar Threads

  1. Staffing Scheduling HELP Match/Index
    By mgelston in forum Excel Help
    Replies: 2
    Last Post: 06-20-2013, 01:09 AM
  2. Replies: 6
    Last Post: 06-06-2013, 03:17 AM
  3. Replies: 4
    Last Post: 04-24-2013, 10:04 AM
  4. Replies: 16
    Last Post: 04-19-2013, 08:20 PM
  5. Replies: 2
    Last Post: 03-21-2013, 10:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •