+ Reply to Thread
Results 1 to 8 of 8

Determining Value based on value in another cell

  1. #1
    Registered User
    Join Date
    01-10-2013
    Location
    Tallahassee
    MS-Off Ver
    Excel 2010
    Posts
    30

    Determining Value based on value in another cell

    I am using Excel 2010.

    In Column B, I have 8 digit codes for books. The first cell in Col B with data is B6. Headings are in row 5. The total number of rows varies.
    Column B has numbers but they are formatted as text.
    Please help me with code that would go down column A and automatically fill the column with values as indicated below.

    If the first four letters of the value in B is 5400 then
    Value in A should be "Library"

    If the first six numbers in column A is 640000
    Then the Value of A Should be "Office"

    if the first six letters Column B is 640055 then
    The Value of A should be "Office - GA"

    If the code begins with 64 except the two above then
    The Value of A should be "LAW"

    All other codes should be "Misc"

  2. #2
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: Determining Value based on value in another cell

    Since you aren't comparing the same number of digits, it gets a little complicated to create a function. It might just be easier to use the filter/sort feature and enter in your five category names by section.

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: Determining Value based on value in another cell

    Hi, Try such simple piece (if there is plenty of rows it could be wise to disable automatic calculation at begining and enable at end).


    Please Login or Register  to view this content.
    Best Regards,

    Kaper

  4. #4
    Registered User
    Join Date
    01-10-2013
    Location
    Tallahassee
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: Determining Value based on value in another cell

    Kaper, this works very well as written. I also understand what you have done. However, there is one other issue:

    How do I add the "other 64s" -- those starting with 64, but not being 640000 or 640055?

    I have eleven 8 digit codes and will have between 400 to 800 rows of data.

    Thank you.

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Determining Value based on value in another cell

    Another:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-10-2013
    Location
    Tallahassee
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: Determining Value based on value in another cell

    Many thanks, John. I tested this over and over again and it worked perfectly every time.

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Determining Value based on value in another cell

    You're welcome. Glad to help out and thanks for the feedback. Please review the Forum Rules and mark this thread as solved.

    http://www.excelforum.com/forum-rule...rum-rules.html

  8. #8
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: Determining Value based on value in another cell

    Hi,
    In my version you can nest another IF:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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] Determining Column Based on Range Name
    By PosseJohn in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-13-2013, 02:27 PM
  2. [SOLVED] Formula for checking a cell and determining data set based on cell value
    By fauxreality in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-18-2013, 11:40 AM
  3. Replies: 6
    Last Post: 04-07-2011, 01:07 PM
  4. Determining Date X based on Other dates
    By MIchel Khennafi in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-03-2006, 11:50 AM
  5. determining a price based on 700 combinations
    By crimsonkng in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-26-2005, 05:19 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