+ Reply to Thread
Results 1 to 10 of 10

subtracting with vlookup?

  1. #1
    Registered User
    Join Date
    12-09-2008
    Location
    U.S.
    Posts
    15

    subtracting with vlookup?

    if lic# in column a = lic # in column e, i would like to use the corresponding avg wt in column f to subtract column b.

    would i have to use if and vlookup function? (i.e. =if(a=vlookup(....), f-c)??).

    any help would be much appreciated.
    Attached Files Attached Files
    Last edited by noobnxcl; 12-18-2008 at 01:13 AM.

  2. #2
    Forum Contributor vandanavai's Avatar
    Join Date
    09-04-2006
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    256
    Hello

    Try this formula in Cell C2, C3 etc


    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-09-2008
    Location
    U.S.
    Posts
    15
    thanks, that seems to work. but i forgot to add in if column b is less than the avg wt will i want to obtain the difference. how can i add that in?

    =if(and(b2<volookup(a2,e2:f67,2,false),if((match(a2,e2:e67,)),<>"#$NA",(vlookup(a2,a1:f200,6,0)-b2))

    i keep getting invalid formula.

  4. #4
    Registered User
    Join Date
    12-09-2008
    Location
    U.S.
    Posts
    15
    sorry, lastly, how can i also get rid of #VALUE! that shows up?

  5. #5
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111
    G'day

    Does this help

    Please Login or Register  to view this content.
    Please double check the formula. Its getting late here. Ta.
    Have I made you happy ??? If yes, please make me happy by pressing the http://www.excelforum.com/images/buttons/reputation-40b.png Add Reputation button in my post.
    Please don't forget to do the same to other contributors of this forum.

    Thanks
    I don't void confusion, I create it

  6. #6
    Registered User
    Join Date
    12-09-2008
    Location
    U.S.
    Posts
    15
    thank you all for your help. this is such a great site! wish i had found this site sooner.
    Last edited by noobnxcl; 12-14-2008 at 09:14 AM.

  7. #7
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111
    Quote Originally Posted by noobnxcl View Post
    may i ask what =if(b2="",""....refers to?
    This to get rid of the #VALUE because of the Vlookup and the Match formula are looking for a value when there is no value an error will return in the formula.

    So when B2 is "" (blank) the formula stays blank

    Cheers

  8. #8
    Registered User
    Join Date
    12-09-2008
    Location
    U.S.
    Posts
    15
    sorry, i thought it was solved but found out it wasn't.

    ratcat, thx so much for the quick reply. the problem i am having now is that i only want to subtract column b if it is less than the avg wt in column f.

    for example, c16 should be blank since b16 is greater than f2.

  9. #9
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211
    Quote Originally Posted by noobnxcl View Post
    sorry, i thought it was solved but found out it wasn't.

    Ratcat, thx so much for the quick reply. The problem i am having now is that i only want to subtract column b if it is less than the avg wt in column f.

    For example, c16 should be blank since b16 is greater than f2.

    =if(countif(e:e,a2),if(vlookup(a2,e:f,2,)>b2,vlookup(a2,e:f,2,)-b2,""),"")

  10. #10
    Registered User
    Join Date
    12-09-2008
    Location
    U.S.
    Posts
    15
    thank you so much!

+ Reply to Thread

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.6.0 RC 1