+ Reply to Thread
Results 1 to 3 of 3

Find COLUMN number based upon cell contents

  1. #1
    Registered User
    Join Date
    04-03-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    5

    Find COLUMN number based upon cell contents

    I have a large list of scores from a league I run - many years worth in my "Scores" tab. For a large number of formulas I need to locate the start of the data for the current year (i.e. the column number). I have been doing this manually every year, and I usually forget... There is a year in each column of this data (2007, 2008, etc.) in row 4.

    What I need is a formula that will tell me the column number of the first column of a year based upon the contents of another cell in my "Tables" tab. So for instance if I enter 13 for the current year [Year], the YearStartCol will update to 122 (4x26+18)

    Spreadsheet attached
    Attached Files Attached Files

  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,434

    Re: Find COLUMN number based upon cell contents

    Be better if you put the full year in. Then you could use Match:

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


    You could always use:

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



    Regards, TMS
    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
    Registered User
    Join Date
    04-03-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Find COLUMN number based upon cell contents

    Thanks TMS. I'm getting close. Match is definitely the function I need. However, the data types are proving problematic. The (2-digit) Year in the Tables tab is a number while the (4-digit) years in the Scores tab are text fields.

    =MATCH(2000+B1,Scores!4:4,0)

    returns #N/A

    However,

    =MATCH("20"&TEXT(B1,0),Scores!4:4,0)

    works, but only for years starting at 2010.

    So, I could put an IF statement in the function, like:

    =MATCH(IF(B1<10,"200","20")&TEXT(B1,0),Scores!4:4,0)

    Works!

    Thanks for your help!
    Last edited by fedude; 08-04-2013 at 07:56 AM. Reason: Clarity

  4. #4
    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,434

    Re: Find COLUMN number based upon cell contents

    You're welcome. Thanks for the rep.

    You could just use:

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



    Regards, TMS

+ 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. Find last cell in column B, message box contents of column A
    By Nu2Java in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-03-2013, 11:27 AM
  2. Formula/macro to edit cells in one column based on contents of a cell in another column
    By robbyvegas in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-25-2012, 06:10 AM
  3. [SOLVED] Clear Cell Contents based on Number Format
    By lloydgodin in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-17-2012, 04:55 PM
  4. Find cell based on formula result and delete contents
    By Big Chris in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-29-2006, 10:07 AM
  5. [SOLVED] Set number format based on cell contents
    By nospaminlich in forum Excel General
    Replies: 5
    Last Post: 12-08-2005, 02:45 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