+ Reply to Thread
Results 1 to 9 of 9

Count number of data between two columns

  1. #1
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Count number of data between two columns

    Hi Experts,

    Need help on counting the data between two values on different cells.

    So what i would like the formula to do is find the first occurrence of "B" and "L" in a row then count the number of columns between the two.

    So if the first "B" is in A1 and the first "L" is in F1 then there are 4 columns/characters between them.

    Hope I make sense. Thank you.
    If I've helped U pls click on d *Add Reputation

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Count number of data between two columns

    Try this
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Contributor
    Join Date
    05-06-2016
    Location
    Cluj, Romania
    MS-Off Ver
    2007-2010
    Posts
    220

    Re: Count number of data between two columns

    Hi,
    something like this?
    Capture.JPG

    see attached
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: Count number of data between two columns

    Thanks Alkey what if i would like to use just one formula to count the columns between the first occurrence of "B" and "L" (there could be different occurrence of both letters in the row)


    Thank you

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Count number of data between two columns

    Quote Originally Posted by bhenlee View Post
    what if i would like to use just one formula to count the columns between the first occurrence of "B" and "L" (there could be different occurrence of both letters in the row)
    Not sure what you're asking.

    Post some sample data and tell us what result you expect.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Count number of data between two columns

    If you need to establish position of two letters then you need two formulas

  7. #7
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: Count number of data between two columns

    Hi Tony well say in row 1

    AAABAAAAAAAALLLLAAAAAB -- i would like to count the number of A's between the first occurrence of "B" and "L".. then as too what Alkey stated I would like to count the number of A's between the last occurrence of "L" and 2nd occurrence of B.

    Yes Alkey i'd probably need two formulas

    Thank you experts

  8. #8
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Count number of data between two columns

    Try this
    Formula in A3
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v A B C D E F G H I J K
    1 A A B A A A A A L L L
    2
    3 5
    4
    Last edited by AlKey; 08-29-2016 at 09:25 AM.

  9. #9
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: Count number of data between two columns

    Thank you Alkey!!! Works perfectly

+ 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. count columns with data then insert that number of rows
    By johnson1421 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-12-2014, 06:54 PM
  2. [SOLVED] count number of pivot columns
    By MarMo in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 02-01-2013, 08:52 AM
  3. Count number of pairs between 2 columns
    By Johnald in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-09-2013, 06:46 PM
  4. Number of Rows or Columns count
    By zulkfal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-19-2012, 11:40 PM
  5. [SOLVED] Count unique value for each row in a number of Columns
    By rickyilas in forum Excel General
    Replies: 6
    Last Post: 05-23-2012, 09:14 PM
  6. compare columns and count number of matching columns
    By san000 in forum Excel General
    Replies: 1
    Last Post: 07-15-2009, 10:31 PM
  7. VBA to count number of columns
    By blucky in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-13-2008, 09:20 AM
  8. Count Number of Columns
    By mrdata in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-03-2007, 04:44 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