+ Reply to Thread
Results 1 to 6 of 6

Help assigning number value to letter based on position within a sequence

  1. #1
    Registered User
    Join Date
    02-27-2014
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 2013
    Posts
    5

    Help assigning number value to letter based on position within a sequence

    I am using Microsoft Excel 2013. I am hoping for an explanation on how to accomplish the following using Excel...

    I have a list of approx. 1000 9-character sequences of letters (ex: GANTQYFGA) in one column (column B).
    In the next 9 columns (column C-K), I have each letter from the respective sequence in its own separate cell (ex: c2-G, d2-A, e2-N, etc)
    I want to assign a number value (essentially a score) to each letter in the sequence, depending on its position in the sequence. For example, if a "G" is in position 1, it's score would be X. If a "G" is in position 8, it's score would be Y. There are 20 possible letters that can be found in 9 possible positions, for a total of 180 individual score values that are in my "key". To be brief, the values in my "key" are from previous data. For my new data set, I am attempting to score each 9-letter sequence based on values calculated from my previous data (values are based on the frequency at which a certain letter was found at that position in the sequence).

    Rather than go through each 9-letter sequence, refer to my key, and manually type in each value (for roughly 1000 sequences, this would require me to manually enter 9000 values!), I am hoping there is a way to input my "key" into excel and have it fill in the values for each position of every sequence.

    Can anyone help me figure out how to do this? I have a very basic skill level using Excel. I've never used any advanced programming or macros.

    I have attached a copy of my .xls data file for reference. On the right ride (columns AA-AJ) is how I would like the output to look. Ignore columns A, L & M, as well as P1-3 & Q1-3 and any highlighting (irrelevant to this question).

    I would really appreciate any assistance!

    Thanks,
    Alex
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Help assigning number value to letter based on position within a sequence

    Hello,

    No need of a macro. Try this formula in AA2 and copy to the right and down.

    Please Login or Register  to view this content.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Help assigning number value to letter based on position within a sequence

    This sounds do-able. what are the values you need to apply to this?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    02-27-2014
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Help assigning number value to letter based on position within a sequence

    This worked perfectly!

    Thank you GC Excel!!

  5. #5
    Registered User
    Join Date
    02-27-2014
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Help assigning number value to letter based on position within a sequence

    Problem solved FDibbins. Thanks anyway!

  6. #6
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Help assigning number value to letter based on position within a sequence

    You're welcome and thanks for the rep !

+ 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. generate number sequence based on cell value
    By Pmaldini3 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-22-2015, 07:13 AM
  2. sequence number based on date
    By denise in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-19-2014, 03:09 PM
  3. VBA - Add a Sequence Number based on Condition
    By AGALLEGOS in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-12-2014, 06:03 PM
  4. Replies: 5
    Last Post: 08-21-2013, 09:31 AM
  5. [SOLVED] Assigning a number value to a letter?
    By Orphan86 in forum Excel General
    Replies: 3
    Last Post: 08-30-2005, 07:05 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