+ Reply to Thread
Results 1 to 8 of 8

Thread: to number a specified column of cells according to a value I've entered

  1. #1
    Valued Forum Contributor swordswinger710's Avatar
    Join Date
    02-20-2008
    Location
    Bright, Canada
    MS-Off Ver
    2010
    Posts
    515

    Exclamation Can Excel Do This?

    I need Excel to number a specified column of cells according to a value I entered in another cell.

    Example One:

    Cell A2 on Sheet 1 recieves the number 30.

    Cells B3 to B33 on Sheet 2 should now have numbers 1 through 30 in them in ascending order.


    Example Two:

    Cell A2 on Sheet 1 recieves the number 17.

    Cells B3 to B20 on Sheet 2 should now have numbers 1 through 17 in them in ascending order.


    Is there a formula for this? I would really appreciate any response.

    Thanks in advance.
    Last edited by swordswinger710; 02-21-2008 at 02:40 PM.

  2. #2
    Valued Forum Contributor Dunc3142's Avatar
    Join Date
    09-05-2007
    Location
    Franklin OH
    MS-Off Ver
    2000 and 2007 @ Home & Teach 2007
    Posts
    209

    By Jove I think I got it.

    Let me know if this works for you.
    Attached Files Attached Files
    Yes it will. we just have to figure out how...

  3. #3
    Valued Forum Contributor swordswinger710's Avatar
    Join Date
    02-20-2008
    Location
    Bright, Canada
    MS-Off Ver
    2010
    Posts
    515

    Exclamation That Was Quick, How'd You Do It?

    Thanks a lot! That works quite well! I guess my second question is this - how'd you do it? I did have something myself, but how do you enter the formulas into all those cells without having to manually edit the formula in each one, like I had to?

    Here's my formula:

    =IF(C2>0, (1), (""))
    =IF(C2>1, (2), (""))
    =IF(C2>2, (3), (""))
    ...and so on.

    Now did you have to paste your formula into every cell like I did, and edit those two numbers before going to the next one? That, I suppose, is actually the question.

  4. #4
    Valued Forum Contributor Dunc3142's Avatar
    Join Date
    09-05-2007
    Location
    Franklin OH
    MS-Off Ver
    2000 and 2007 @ Home & Teach 2007
    Posts
    209

    How??

    When writing the formula, the $ before the C and before the 3 ($C$3) means that that part of the formula will not change when you copy it down.

    =IF(A4="","",IF(A4<>$C$3,A4+1,""))

    Copying the formula, I used the fill handle, (little black square in the bottom right corner of the active cell) to copy the formula down, mouse pointer changes into a small thin cross hair. When doing that the references that do not have $ in them will change to reflect new rows while the references that do have $ in them will not change.

    The reason for the complicated formula was to keep #ERROR from being in the cells after the number was reached. The first if statement checks for the first cell with nothing in it and continues the entry after the first balck cell with more black cells. The second if statement will work by itself but when your number is reached you will start getting #ERROR in the cell.
    Attached Images Attached Images
    Yes it will. we just have to figure out how...

  5. #5
    Valued Forum Contributor swordswinger710's Avatar
    Join Date
    02-20-2008
    Location
    Bright, Canada
    MS-Off Ver
    2010
    Posts
    515

    Exclamation Aha!

    I always knew that $ would one day be good for something! So there is only one more issue - if C3 in your example is 0 or empty - cells A3 to infinity are now full of numbers. Is there a way for them to display nothing if nothing is entered?

  6. #6
    Valued Forum Contributor Dunc3142's Avatar
    Join Date
    09-05-2007
    Location
    Franklin OH
    MS-Off Ver
    2000 and 2007 @ Home & Teach 2007
    Posts
    209

    Put this in cell A3

    Put the following formula in cell A3

    =IF(C3=0,"",C3-(C3-1))
    That will fix it.
    Yes it will. we just have to figure out how...

  7. #7
    Valued Forum Contributor swordswinger710's Avatar
    Join Date
    02-20-2008
    Location
    Bright, Canada
    MS-Off Ver
    2010
    Posts
    515

    Exclamation Impressive

    Man, that was great! Thanks so much for all your input (and output). I do have several other Excel riddles that I need help with - if you're up to it. What do you say?

  8. #8
    Valued Forum Contributor Dunc3142's Avatar
    Join Date
    09-05-2007
    Location
    Franklin OH
    MS-Off Ver
    2000 and 2007 @ Home & Teach 2007
    Posts
    209

    Sure

    Send them my way.
    Yes it will. we just have to figure out how...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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.2.0