+ Reply to Thread
Results 1 to 3 of 3

Vlookup/If formula assistance

Hybrid View

  1. #1
    Registered User
    Join Date
    03-27-2012
    Location
    Tampa, FL
    MS-Off Ver
    Excel for M365
    Posts
    54

    Lightbulb Vlookup/If formula assistance

    Hi everyone,

    I am in the process of mapping customer changes in our database. Please see attached excel spreadsheet:

    * tab 1 shows 4 columns: the old customer ID, the currency the customer is billed in, the legal entity the customer belongs to and the new customer ID.
    * tab 2 shows the same information as the first; however this tab highlights how one old customer ID can equal multiple new customer IDs since the new IDs are further segregated by billed currency and legal entity.
    * tab 3 shows the raw data I am trying to map, the old customer ID is in column J and currently there is a vlookup formula linked to tab 1 in column K.

    My question is this: is there a formula I can write that can somehow "check" the customers that may be on tab 2? Ideally what I'd like to do is the following: is the old customer ID on tab 2? If no, pull new customer ID from tab 1. If yes, then check column C on tab 3 against column B on tab 2 and select correct customer based on currency [after first checking for customer ID], if currency is the same then check column B on tab 3 against column C on tab 2 [after first checking for customer ID and currency].

    I know I need to correct my raw data to change column B to company name vs company code since that is how the other tabs are formatted.

    I believe I can use some kind of nested "if" formula, but I'm striking out. Any help you can provide would be appreciated!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: Vlookup/If formula assistance

    tough to be 100% sure since your company ID doesn't actually match..... but I think this does it.

    =IF(ISERROR(MATCH($J2,'Duplicate customers'!$A:$A,0)),VLOOKUP($J2,'Customer mapping'!$A:$D,4,FALSE),IF(COUNTIF(OFFSET('Duplicate customers'!$A$1,MATCH($J2,'Duplicate customers'!$A:$A,0)-1,1,COUNTIF('Duplicate customers'!$A:$A,'Data to map'!$J2),1),'Data to map'!$H2)>1,VLOOKUP($B2,OFFSET('Duplicate customers'!$A$1,MATCH($J2,'Duplicate customers'!$A:$A,0)-1+MATCH($H2,OFFSET('Duplicate customers'!$A$1,MATCH($J2,'Duplicate customers'!$A:$A,0)-1,1,COUNTIF('Duplicate customers'!$A:$A,'Data to map'!$J2),1),0)-1,2,COUNTIF(OFFSET('Duplicate customers'!$A$1,MATCH($J2,'Duplicate customers'!$A:$A,0)-1,1,COUNTIF('Duplicate customers'!$A:$A,'Data to map'!$J2),1),'Data to map'!$H2),2),2,FALSE),VLOOKUP($H2,OFFSET('Duplicate customers'!$A$1,MATCH($J2,'Duplicate customers'!$A:$A,0)-1,1,COUNTIF('Duplicate customers'!$A:$A,'Data to map'!$J2),3),3,FALSE)))

  3. #3
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: Vlookup/If formula assistance

    forgot to mention you need to duplicate all the data labels on the Duplicate customers tab. i.e. don't leave any blanks in customer ID or Currency... Easy to do with a quick helper column:

    Formula: copy to clipboard
    =IF(A3="",E2,A3)


    placed in E3, drag right and fill all the way down. then copy paste values in a3

+ 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. [SOLVED] Assistance with my VLOOKUP Formula....Please help...
    By dmejia174 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-09-2013, 08:52 PM
  2. [SOLVED] Assistance with PTO Accrural Possible VLOOKUP Formula
    By bwelter in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-10-2013, 10:00 PM
  3. vlookup formula assistance
    By jman667 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-03-2013, 04:58 PM
  4. VLookup Assistance
    By LCurran in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-22-2011, 04:24 PM
  5. Replies: 2
    Last Post: 04-05-2010, 05:13 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