+ Reply to Thread
Results 1 to 5 of 5

Evaluating a range for text and replacing...

  1. #1
    Registered User
    Join Date
    12-25-2021
    Location
    Huntsville, Al
    MS-Off Ver
    Office 365
    Posts
    3

    Evaluating a range for text and replacing...

    I am using a personnel system that labels departments using numbers. I'm trying to efficiently evaluate the cells and if the number is present, replace it with the words.

    I essentially want to evaluate A1:A5, and if it equals anything in B1:B5, then replace it with D1:D5

    For example, if A1=B1 or B2 or B3 or B4 or B5, replace with corresponding value in D column.

    further example, 123 would be replaced with gear dept, 891 would be replaced as spin dept.

    I think I have attached a picture of the sheet, I have tried REPLACE,SUBSTITUE, and even messed around IF functions.

    Any help would be greatly appreciated

    Screenshot 2022-03-08 010739.jpg

  2. #2
    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
    48,150

    Re: Evaluating a range for text and replacing...

    You would need VBA to do that. Is that what you

    Pictures are of little value. Honestly, no one wants to re-type your data to try and solve your issue. Additionally, we would only be guessing at how your data was structured, ie. formulas, formatting, etc. Due to how some browsers behave, many of our members cannot see uploaded pictures/images. Please do not take this route.

    Please attach a sample file that represents what you have. The structure of your attachment should be the same structure as your actual data. Any proprietary information should be changed.

    Include in the attachment any code you're currently using (whether it works or not) and an "After" of what you wish the output to be.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    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


  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Evaluating a range for text and replacing...

    With a reference table, you can use:


    =IF(B2="","",VLOOKUP(B2,F:G,2,FALSE))
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  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
    48,150

    Re: Evaluating a range for text and replacing...

    @Glenn: the OP said …
    I essentially want to evaluate A1:A5, and if it equals anything in B1:B5, then replace it with D1:D5

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Evaluating a range for text and replacing...

    Yes, I know... but quite often what is said is not what is meant!! I made my guess on the basis that it would be odd to have the same values in adjacent columns as a starting point.

+ 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. Evaluating a range using IF function
    By kcliff in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-28-2014, 09:22 AM
  2. Evaluating two colums in range
    By dummyaccount in forum Excel General
    Replies: 1
    Last Post: 08-13-2011, 11:11 AM
  3. Excel 2007 : Evaluating time based on a range
    By SeanMulholland in forum Excel General
    Replies: 2
    Last Post: 01-16-2010, 06:31 PM
  4. If/Then for Evaluating a Range within a Cell?
    By timkay99 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-05-2009, 03:22 PM
  5. Evaluating text as formulae
    By Nigel Ramsden in forum Excel General
    Replies: 2
    Last Post: 10-13-2005, 01:05 AM
  6. RE: Evaluating text as formulae
    By Mike in forum Excel General
    Replies: 0
    Last Post: 10-12-2005, 12:05 PM
  7. [SOLVED] Evaluating a Range of Empty Cells with VBA
    By John Mansfield in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-24-2005, 05:06 AM

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