+ Reply to Thread
Results 1 to 5 of 5

Vlookup help. Anyway to replace a specific value with a custom value? turn N into 0 etc.

  1. #1
    Registered User
    Join Date
    03-05-2015
    Location
    Atlanta
    MS-Off Ver
    2007
    Posts
    2

    Vlookup help. Anyway to replace a specific value with a custom value? turn N into 0 etc.

    Hey guys first post here, looking for some help with a weird request.

    I am trying to do a VLOOKUP to pull data from a column on one sheet to another, (Which I can accomplish), but replace certain found values with a custom term.

    So the column is called "Paperless" and is a list of whether or not that person has paperless or not. The options from the source is "N" and "Y" , [obviously for No, and Yes.]

    the vlookup I have created so far is this;

    =IF(ISNA(VLOOKUP(B2,'[ManageCustomers.xlsx]ManageCustomers (1)'!$A$2:$I$8204,9,FALSE)),"0",VLOOKUP(B2,'[ManageCustomers.xlsx]ManageCustomers (1)'!$A$2:$I$8204,9,FALSE))


    So this pulled the column "paperless" from worksheet2 to worksheet1 and made it so if the #N/A value was returned, it showed a 0. The vlookup works.

    What I am trying to accomplish is to change the "N's" to "0's" as well, and the "Y's" to return 1.


    Right now the vlookup is WORKING , but instead of returning "N" and "Y" I want N to become 0 and Y to become 1 on the worksheet1.

    Is this possible? Please help :D thank you.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Vlookup help. Anyway to replace a specific value with a custom value? turn N into 0 et

    Try this one:
    Please Login or Register  to view this content.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    12-11-2014
    Location
    Dallas, TX
    MS-Off Ver
    2010
    Posts
    94

    Re: Vlookup help. Anyway to replace a specific value with a custom value? turn N into 0 et

    Try this:

    =IF(ISNA(VLOOKUP(B2,'[ManageCustomers.xlsx]ManageCustomers (1)'!$A$2:$I$8204,9,FALSE)),"0",IF(VLOOKUP(B2,'[ManageCustomers.xlsx]ManageCustomers (1)'!$A$2:$I$8204,9,FALSE)="Y",1,IF(VLOOKUP(B2,'[ManageCustomers.xlsx]ManageCustomers (1)'!$A$2:$I$8204,9,FALSE)="N",0)))

    Rats, was beaten to it.
    If I have helped you, please add to my reputation!

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Vlookup help. Anyway to replace a specific value with a custom value? turn N into 0 et

    Are you really using 2007, as your profile indicates? If you are, you can use IFERROR rather than repeating the formula inside IF(ISNA(), ...)

    Whatever, if the result can only be "Y" or "N", test the formula in an IF and choose your outcome. =IF(formula="N",0,1)

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Registered User
    Join Date
    03-05-2015
    Location
    Atlanta
    MS-Off Ver
    2007
    Posts
    2

    Re: Vlookup help. Anyway to replace a specific value with a custom value? turn N into 0 et

    Quote Originally Posted by protonLeah View Post
    Try this one:
    Please Login or Register  to view this content.

    This worked out great thank you

    So the logic of this statement is that if any error shows up, replace it with 0. if Y would be shown, show 1. If anything else would show (thus, 0) then show 0?

    thank you!!

+ 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] Turn filter off on a specific sheet
    By Consty1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-17-2013, 07:35 AM
  2. Can I turn a formula into a custom function to shorten it?
    By Bill_Holland in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-04-2013, 03:40 AM
  3. Turn a custom function into a macro.
    By dymention2 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-14-2012, 08:19 AM
  4. Creating a Marco to Replace a Specific Number with a Specific Letter in a Column
    By goldbeje in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-27-2011, 11:26 AM
  5. Replies: 3
    Last Post: 10-27-2008, 08:50 AM

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