+ Reply to Thread
Results 1 to 5 of 5

Thread: Look up and replace

  1. #1
    Registered User
    Join Date
    11-22-2008
    Location
    Cleveland OH USA
    Posts
    44

    Look up and replace

    I have a colum of customer ids then I have aother colum of customer ids with a status number in the next colum

    I've uploaded a sample colum a has the formula
    the problem is it is not exact if it doesn't find the customer it goes down 1 row or so and puts in a number. I need to know if found replace if not fund have a 0 or a null or somehting

    any help would be appreciated
    Attached Files Attached Files

  2. #2
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,423

    Re: Looking up and replaceing

    If you're happy with 0 then a simple solution would be SUMIF

    A2: =SUMIF(C:C,B2,D:D)
    copied down

    (there are no matching records in your sample)

  3. #3
    Registered User
    Join Date
    11-22-2008
    Location
    Cleveland OH USA
    Posts
    44

    Re: Looking up and replacing

    that worked great!
    I have one more I tried the sumif and it didn't work I have the lookup in there but don't trust it

    I want to compair 2 sets or custid's I want to lookup in colum a id from colum d and compair the to rf scores and show the difference if not found a zero woudl be fine

    if what I have works I'm just confirming

    Once again thanks
    Attached Files Attached Files

  4. #4
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,423

    Re: Looking up and replacing

    The issue with the SUMIF is that the numbers stored in Cols B & E are in fact stored as text - ie they are not "true" numbers.

    An alternative approach:

    G2: =LOOKUP(9.99E+307,CHOOSE({1,2},0,VLOOKUP(A2,D:E,2,0)-B2))
    copied down
    The LOOKUP here is used as an error handler to return 0 for no match, if you're using XL2007 or beyond then use

    G2: =IFERROR(VLOOKUP(A2,D:E,2,0)-B2,0)
    copied down
    of course if you want to treat "not found" as 0 in terms of the subtraction the above can be modified accordingly

  5. #5
    Registered User
    Join Date
    11-22-2008
    Location
    Cleveland OH USA
    Posts
    44

    Re: Looking up and replacing

    g2: =IF((SUMIF(A:A,D2,B:B))>0,E2-(SUMIF(A:A,D2,B:B)),0)

    The above worked when I used the
    G2: =LOOKUP(9.99E+307,CHOOSE({1,2},0,VLOOKUP(A2,D:E,2,0)-B2))

    I still got numbers in colum g for custid that were not found

    The above formula works

    Thanks for all your help

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