+ Reply to Thread
Results 1 to 3 of 3

Extract number from a cell and conditionally enter text

  1. #1
    Registered User
    Join Date
    01-03-2018
    Location
    Greece
    MS-Off Ver
    2016 365
    Posts
    12

    Extract number from a cell and conditionally enter text

    Hello,

    This is an exmpale of column B values assuming they start from fisrt row:
    1
    2
    3
    T1
    4
    DAT1
    DAT2
    T2
    5
    6
    etc

    What I am trying to do is this:
    Column B is filled with either a)only numbers b)a specific letter, letter T always, and numbers e.g. T345 c) three specific letters, always letters DAT and numbers e.g. DAT9741. There are no other types of entered values.
    I would like to enter the number of row in cell A1 of the corresponding value and make excel return only the number value of the cell.
    For example
    1. If I input value 4 the cell data will be T1, and I want to extract number 1.
    2. If I input value 9 the cell data is 5, and I want to extract the number itself, number 5.
    3. If I input value 6 the cell data is DAT1, and I want to extract the number 1.

    Also I wouls like to make excel write something on a cell depending if the previous selected cell is a number, starts with T, or starts with DAT.
    For example
    1. If I enter number 4 I would like in cell J12 write the sentence "Invoice" because cell B4 starts with T"Receipt",
    2. If I enter number 9 I would like in cell J12 write the sentence "Receipt" because cell B9 is ONLY number, and
    3. If I enter number 6 I would like in cell J12 write the sentence "Purchase" because cell B6 starts with DAT

    I hope I made it clear...

    Thank you for any help!!!

  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
    44,464

    Re: Extract number from a cell and conditionally enter text

    Try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    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 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,464

    Re: Extract number from a cell and conditionally enter text

    Use LEFT to extract 1 or 3 characters and test for T and DAT respectively. Nest the IF statements.

+ 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] Enter number in blank cell match number on sheet 2 & enter data from adjacent cell
    By Bikeman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-10-2015, 08:36 PM
  2. [SOLVED] Extract number within text in a cell
    By YasserKhalil in forum Excel General
    Replies: 7
    Last Post: 10-29-2014, 02:12 AM
  3. extract number from text and number cell
    By south in forum Excel General
    Replies: 15
    Last Post: 08-23-2014, 03:28 AM
  4. conditionally enter data in a cell based on content of another cell
    By jrustebakke in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-09-2014, 02:47 PM
  5. Replies: 1
    Last Post: 06-15-2011, 02:36 AM
  6. Replies: 5
    Last Post: 02-11-2009, 06:02 PM
  7. Replies: 1
    Last Post: 04-17-2005, 01:06 PM

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