+ Reply to Thread
Results 1 to 8 of 8

Need to Populate a list of cells increasing a specific formula value by one each time

  1. #1
    Registered User
    Join Date
    09-22-2009
    Location
    South Coast, England
    MS-Off Ver
    Excel 2007
    Posts
    36

    Need to Populate a list of cells increasing a specific formula value by one each time

    Hi.

    I use an excel spreadsheet to monitor what I wear each day. Odd I know but it works for me

    The spreadsheet helps me see if I am not wearing something and thus can get rid of it or perhaps look too use it more. An example of my tops/shirts is attached to show you what I have, but the full version covers ALL my clothes with more detail than shown in my example.

    I have now created a separate spreadsheet which gives me monthly and yearly usage of each item using a formula I was assisted with here last year. This spreadsheet was had to be redone from scratch because of a reorganisation of the original spreadsheet, clothes bought/discarded etc and some other bits I needed to change.

    What I now need to do is copy the formula from columns C to O Row 4 into each row below but if I use the Duplicate command or pull the list down to Auto populate the cells it changes the cell range which is searched and not the search critera. So the formula:

    =COUNTIF('D:\[Clothes-Inventory-Test.xlsx]Shirt Usage'!B24:AG35,"*01*")
    becomes
    =COUNTIF('D:\[Clothes-Inventory-Test.xlsx]Shirt Usage'!B24:AG35,"*01*")
    =COUNTIF('D:\[Clothes-Inventory-Test.xlsx]Shirt Usage'!B25:AG36,"*01*")
    =COUNTIF('D:\[Clothes-Inventory-Test.xlsx]Shirt Usage'!B26:AG37,"*01*")

    and not

    =COUNTIF('D:\[Clothes-Inventory-Test.xlsx]Shirt Usage'!B24:AG35,"*01*")
    =COUNTIF('D:\[Clothes-Inventory-Test.xlsx]Shirt Usage'!B24:AG35,"*02*")
    =COUNTIF('D:\[Clothes-Inventory-Test.xlsx]Shirt Usage'!B24:AG35,"*03*")

    Which is what I actually need. So my question is this: Is there a way to tell or get Excel to increase the search criteria by one each time but leave the search range alone? Or do I need to copy the formulas and then manually edit each cell? Bearing in mind on the example this is 1873 cells and I would have to increase that by around 4 times to cover the other items I have as well so it is not a task I want to do manually at all!

    I hope that makes sense and if anyone can help (even if it is to say it can't be done) I would really appreciate it as I have no idea and everything I have tried has come to nothing


    Thanks
    Andy

    Clothes-Inventory-Test.xlsx Clothes-Stats-Test.xlsx
    Last edited by MaximusPrimal; 01-10-2016 at 04:15 PM. Reason: Presentation

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,824

    Re: Need to Populate a list of cells increasing a specific formula value by one each time

    You can put dollar symbols in the cell references which turns them into absolute address - they do not change when you copy down (or across). Do it like this:

    =COUNTIF('D:\[Clothes-Inventory-Test.xlsx]Shirt Usage'!$B$24:$AG$35,"*01*")

    Also, you need some function which increases by 1 on each successive row, but returns two digits - you can do that like this:

    =COUNTIF('D:\[Clothes-Inventory-Test.xlsx]Shirt Usage'!$B$24:$AG$35,"*"&TEXT(ROWS($1:1),"00")&"*")

    then copy down.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    09-22-2009
    Location
    South Coast, England
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Need to Populate a list of cells increasing a specific formula value by one each time

    Thank you Pete, I did not realise that the $ sign did that so that is helpful to know.

    I will give this a go and see if I can get it working from there.

    Edit: I tried this but Excel is returning false results when it finds 3 digit numbers. So if I have a "112" stored Excel is reading it as 11,12 and 112 which is obviously wrong. I tried to change the "00" to "000" to see if that would force it to read 3 digits but returns a result of 0.

    Changing the "00" to "0" where there are 2 digits or more returns the same false results as it is still reading the "11" and "12" within the number 112.

    Not sure why this is as I thought it would look for a specific number and not a part result.


    Many thanks
    Andy
    Last edited by MaximusPrimal; 01-11-2016 at 02:45 AM. Reason: Problem with Formula

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,824

    Re: Need to Populate a list of cells increasing a specific formula value by one each time

    It is the asterisks that are causing the partial matches. Perhaps you can give us some examples of the range of numbers that you have in the range B24:AG35 and what it is that you want to count.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    09-22-2009
    Location
    South Coast, England
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Need to Populate a list of cells increasing a specific formula value by one each time

    Hi.

    The reason for the asterisk's is that on occasion I may change an item, say if I was going out after work or I got something dirty in the day. So column AG was set up to allow this so I could add something like "32 / 24 / 101" to signify and changes. Perhaps the way around this (and this is part of why I am updating it for 2016) is to have a separate sheet for changes [say "Shirt Usage Additional" so that way I both see days when I had to change something and also I can revert the cells to numbers they should be.

    The range of numbers I would search would be between 1 and 150 at present and needs to be exact matches so if it sees a 12 that is how it is seen and not mis-reading 112 as a 12 as well.

    Andy

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,824

    Re: Need to Populate a list of cells increasing a specific formula value by one each time

    Okay, well perhaps this is what you should use:


    =COUNTIF('D:\[Clothes-Inventory-Test.xlsx]Shirt Usage'!$B$24:$AG$35,ROWS($1:1))

    then copy down.

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    09-22-2009
    Location
    South Coast, England
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Need to Populate a list of cells increasing a specific formula value by one each time

    Thanks Pete.
    I appreciate your help with this one.

    Andy

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,824

    Re: Need to Populate a list of cells increasing a specific formula value by one each time

    Glad to help, Andy.

    You might also like to click the "star" icon.

    Pete

+ 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. Replies: 3
    Last Post: 08-19-2014, 01:57 PM
  2. Need a drop down list to populate multiple cells with specific data
    By tbo812 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-08-2014, 02:08 PM
  3. Replies: 0
    Last Post: 10-23-2012, 04:59 PM
  4. Populate selected rows with formula increasing by "1"
    By matys in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-26-2011, 09:48 AM
  5. Replies: 15
    Last Post: 10-11-2009, 11:46 AM
  6. [SOLVED] Increasing the date/time in cells on a worksheet with a button
    By RMF in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-06-2006, 03:50 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