+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    03-11-2010
    Location
    SHerwood
    MS-Off Ver
    Excel 2007
    Posts
    9

    Formula using two vlookups

    In the final stage of my parsing project--the last step I am having trouble with. What I am trying to do is as follows:

    I want the procedures to VLOOKUP the value "Total" in column "A". When the proc finds a line containing the word "Total", I went the proc to place a formula in column E of the same line that subtracts the department "<900" total from the column "A" total.

    It's probably easier to look at the problem--I have a "before" and "after" spreadsheet attached.

    Any help very much welcome.

    Thanks,

    Reb
    Attached Files Attached Files
    Last edited by Rebel_42MDx; 03-17-2010 at 02:13 AM.

  2. #2
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,147

    Re: Formula using two vlookups

    =IF(AND(A2<>"Grand Total",ISNUMBER(SEARCH("Total",A2))),D2-LOOKUP(2,1/(B$1:B1="<900 Total"),D$1:D1),"")

    copied down
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    03-11-2010
    Location
    SHerwood
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Formula using two vlookups

    I'm sorry--this formula doesn't work... Is there a way to do this as a procedure instead of a formula?

    Many thanks for the help--I'm slowly starting to learn VBA--I think!

    Thanks,

    Rebel

  4. #4
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,147

    Re: Formula using two vlookups

    I can't help you with your VBA request but I wanted to show you that the formula does work for your data.. see column F in the attached compared to your column E
    Attached Files Attached Files
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  5. #5
    Registered User
    Join Date
    03-11-2010
    Location
    SHerwood
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Formula using two vlookups

    Yes, it does work! For some reason it returned an error when I tried to paste the formula--I copied to same column you did then deleted the column to the left and it works like a charm.

    Nice formula--thanks again for the help!

    R

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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.2.0