+ Reply to Thread
Results 1 to 12 of 12

How to get the same value of Preceeding column values with different values of another

  1. #1
    Registered User
    Join Date
    12-24-2013
    Location
    Hyderabd
    MS-Off Ver
    Excel 2003
    Posts
    6

    How to get the same value of Preceeding column values with different values of another

    Hi,

    I had a data which is related to my project. One column is having values like s1, s1.1, s1.2.... and s2, s2.2.......etc., my problem is that i need to get the value of preceding cell value with comparing to this column values. Like if s1 preceding cell value is 1 then i should get the same '1' to s1.1, s1.2....same as like s2.1, s2.2 value to be '30'.. Please help me in this issue. which function should i use to get those values.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,286

    Re: How to get the same value of Preceeding column values with different values of another

    Please post a small file showing examples of required outcomes.

    To post a file, click "Go Advanced" then "Manage Attachments"

  3. #3
    Registered User
    Join Date
    12-24-2013
    Location
    Hyderabd
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: How to get the same value of Preceeding column values with different values of another

    pls find sample
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,286

    Re: How to get the same value of Preceeding column values with different values of another

    Sorry but I still don't understand what you want: add manual examples (and post a smaller file).

  5. #5
    Registered User
    Join Date
    12-24-2013
    Location
    Hyderabd
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: How to get the same value of Preceeding column values with different values of another

    sir,
    for s1 the preceding cell value is 1, so the disease number should be '1' and for s1.1 also the Disease number should be '1' only . same as for s2..etc. the continuous number should have the same value.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,286

    Re: How to get the same value of Preceeding column values with different values of another

    In C2 and copy down

    =IFERROR(INDEX($A$2:$A$30,MATCH(LEFT($B3,FIND(".",$B3)-1),$B$2:$B$30,0)),RIGHT(B3,LEN(B3)-1))

    Assumed the "major" categories are in rows 2 to 30 of B

  7. #7
    Registered User
    Join Date
    12-24-2013
    Location
    Hyderabd
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: How to get the same value of Preceeding column values with different values of another

    thank you, can you explain how did you work on it.

  8. #8
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: How to get the same value of Preceeding column values with different values of another

    C2=
    Please Login or Register  to view this content.
    Try this and copy towards down
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,286

    Re: How to get the same value of Preceeding column values with different values of another

    =IFERROR(INDEX($A$2:$A$30,MATCH(LEFT($B3,FIND(".",$B3)-1),$B$2:$B$30,0)),RIGHT(B3,LEN(B3)-1))


    The part of the formula in RED:

    The MATCH uses the text prior to the first full stop to find the entry in rows B2:B30

    For example if B3 contained S1.1.2

    FIND returns the position of the first "." i.e 3 in this case, and we subtract 1 to get 2.

    LEFT(B3,2) = "S1" i.e the first two characters from the left

    MATCH then finds the corresponding value (of "S1") in column B giving the row number

    INDEX then takes the corresponding value from Column A

    If there is no full stop we get an error which where the IFERROR comes into play;

    If there is an error, then get the number to the RIGHT of the text in B

    If B3=S12 then RIGHT(B3,LEN(B3)-1)) subtracts 1 to from the length of the text i.e 3 -1 =2 so the results is 12 (rightmost 2 characters)

    Hope this explains how it works.

  10. #10
    Registered User
    Join Date
    12-24-2013
    Location
    Hyderabd
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: How to get the same value of Preceeding column values with different values of another

    ya thank you.

  11. #11
    Registered User
    Join Date
    12-24-2013
    Location
    Hyderabd
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: How to get the same value of Preceeding column values with different values of another

    yes, mr. siva, this worked. thank you

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,286

    Re: How to get the same value of Preceeding column values with different values of another

    @siva,
    Formula does not work for S3.3.1.1 or S3.4.3 or similar.

+ 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] VBA Code replace old values to new values depends upon column values
    By johnlara in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-09-2015, 08:19 AM
  2. Transpose values in column to rows, and split cell values to extend column
    By SAMMM in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-03-2015, 12:52 AM
  3. [SOLVED] Extract values (row values and column values) with formula
    By bjnockle in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 08-17-2014, 10:13 AM
  4. Replies: 2
    Last Post: 12-30-2013, 08:15 AM
  5. [SOLVED] Remove preceeding apostrophe without removing preceeding 0s
    By nicklesr in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 10-15-2013, 02:01 PM
  6. Macro that will copy values in Column J and paste values to Column B in new sheet
    By Phixtit in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-16-2010, 04:56 PM
  7. assigning date entries to week values and month values to sum column C-N values C-
    By the accountant in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-20-2010, 09:52 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