+ Reply to Thread
Results 1 to 9 of 9

Editing one item in a text and number string if Sheet 2 is altered

  1. #1
    Registered User
    Join Date
    11-01-2018
    Location
    London, England
    MS-Off Ver
    16
    Posts
    14

    Editing one item in a text and number string if Sheet 2 is altered

    Hi guys

    I am working on a large worksheet where multiple sheets affect each other and I've hit a snag.

    In one spreadsheet I have a series of unique numbers beginning with the letter 'E' that populate one of the columns. In sheet two I have two columns that are populated with numbers.

    I want the letter 'E' to update to 'C' when cells in BOTH columns in sheet two are populated.



    I've created a Test spreadsheet to demonstrate what I'm after and what I've done so far (image attached)

    I don't necessarily want to use the SUBSTITUTE formula or really anything in columns L and M, it just seemed the closest formula to do what I need.

    Thanks in advance for your help.

    printscreenTEST.png

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Editing one item in a text and number string if Sheet 2 is altered

    Please try
    =if((Sheet2!C2>0)*(Sheet2!D2>0),"C","E")

  3. #3
    Registered User
    Join Date
    11-01-2018
    Location
    London, England
    MS-Off Ver
    16
    Posts
    14

    Re: Editing one item in a text and number string if Sheet 2 is altered

    Hi Bo_Ry

    Thanks for your help, but this isn't exactly what I'm after. What I want is for the 'E' in the unique number string to update to C, but in the formula supplied, the cell which the formula is inputted in returns 'C'

    So what I want is for cell C2 to return C/01/0012 instead of E/01/0012 when Cell Sheet2!C2 and Sheet2!D2 are populated with anything greater than 0

    Is there any way of doing this?

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Editing one item in a text and number string if Sheet 2 is altered

    Maybe

    =if((Sheet2!C2>0)*(Sheet2!D2>0),"C","E")&"/01/0012"

  5. #5
    Registered User
    Join Date
    11-01-2018
    Location
    London, England
    MS-Off Ver
    16
    Posts
    14

    Re: Editing one item in a text and number string if Sheet 2 is altered

    Hmm, it returns C/01/0012 but only in the cell I input the formula in, not in cell C2

    If cells C2 and D2 = 0 then the number string still needs to read 'E', so cell C2 on sheet 1 should only read 'C' when the cells in Sheet 2 are populated

  6. #6
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: Editing one item in a text and number string if Sheet 2 is altered

    Is cell C2 a formula, or text? If C2 is text, and cannot be a formula, you will likely need to use VBA to alter that cell.

    It might help to post a sample workbook, with example data and desired results. Click on Go Advanced, then Manage Attachments to upload a file.

  7. #7
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Editing one item in a text and number string if Sheet 2 is altered

    I'm confused, Why don't you put formula in C2 if you want C2 to change?

  8. #8
    Registered User
    Join Date
    11-01-2018
    Location
    London, England
    MS-Off Ver
    16
    Posts
    14

    Re: Editing one item in a text and number string if Sheet 2 is altered

    Hi

    Sorry if I haven't been clear enough

    The cells in sheet 1 have to be populated with the unique numbers beginning with either E or C, they can't be formulas because they are raw data.

    They need to respond to the cells in columns C and D in sheet 2 being populated, but it has to be both cells. If only one cell is populated, the data in sheet 1 shouldn't change.
    It also needs to respond only to these two columns, as there will be a lot of data in sheet 2, and shouldn't respond if cells A and B in sheet 1 are populated either.

    I've made a quick test spreadsheet which should give you an idea of how I want it to look. Sheet 1 has the raw data, with columns A and B being populated with other information.
    Sheet 2 has the populated columns.


    Test.xlsx

  9. #9
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: Editing one item in a text and number string if Sheet 2 is altered

    If you can use a formula in column D (or another column) in Sheet1 to provide the results you're looking for, this would work:
    Please Login or Register  to view this content.
    Put this in D2 (or another column in row 2) on Sheet 1, and then drag down. This checks to see if the columns C and D in Sheet2 are both populated. If they are, it removes the first character from the string in column C and replaces it with a "C". If both columns in Sheet 2 are not populated, it just returns the string in column C on Sheet1.

    If you cannot use a formula in a column on Sheet1, and want the results displayed in column C on Sheet1, you'll need VBA to do it. Let us know if this is the case.

+ 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. Replies: 2
    Last Post: 01-05-2018, 12:31 AM
  2. Replies: 3
    Last Post: 03-28-2014, 07:04 AM
  3. [SOLVED] Finding and editing a text string
    By Determined Noob in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-04-2013, 07:19 AM
  4. Insert text before the last item in a string
    By jwac in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-26-2013, 02:33 PM
  5. Replies: 8
    Last Post: 08-07-2012, 10:15 AM
  6. Number entry altered
    By daguerrotype in forum Excel General
    Replies: 1
    Last Post: 01-03-2011, 08:49 AM
  7. Replies: 12
    Last Post: 10-01-2009, 01:05 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