+ Reply to Thread
Results 1 to 16 of 16

How to drag a formula increasing tab number only?

  1. #1
    Registered User
    Join Date
    04-18-2013
    Location
    Staffs
    MS-Off Ver
    Excel 2007
    Posts
    7

    How to drag a formula increasing tab number only?

    Hi Guys,

    I have a spreadsheet that has a tab for every week of the year, the formula in question is below:

    =COUNTA('1'!$C10:$H10)

    How can I drag this formula across increasing the tab number without having to manually change it on each cell?

    Thanks in advance,

    Ba1ley

  2. #2
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,671

    Re: How to drag a formula increasing tab number only?

    If your formula is in G column

    =COUNTA(INDIRECT("'"&Column()-Column($G$1)+1&"'!$C10:$H10"))

  3. #3
    Registered User
    Join Date
    04-18-2013
    Location
    Staffs
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: How to drag a formula increasing tab number only?

    Apologies I should have stated, the formula is on a different tab at the start of the sheet titles "2013".

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,671

    Re: How to drag a formula increasing tab number only?

    Upload dummy file with correct sheet names and where you want formula.

  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: How to drag a formula increasing tab number only?

    Assuming you want the first formula to appear in cell A2 then copied across:

    =COUNTA(INDIRECT("'"&COLUMNS($A2:A2)+2012&"'!C10:H10"))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Registered User
    Join Date
    04-18-2013
    Location
    Staffs
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: How to drag a formula increasing tab number only?

    I'm not very good at explaining this am I, it doesn't help being a complete novice at Excel.

    The formula itself will on tab '2013' in cell 'B140' and when devised correctly dragged all the way across to 'BB140', collecting COUNTA data from tab '1' cells ($C10:$H10). What I want to do is drag the formula across the across the sheet increasing the tab number by 1 each time but keeping all other aspects of the formula the same.

    Does that make sense? If not I'll have to upload a dummy.

    Thanks again.

  7. #7
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,671

    Re: How to drag a formula increasing tab number only?

    pl upload file your supposed formula typed manually in 3 or more cells.

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

    Re: How to drag a formula increasing tab number only?

    Quote Originally Posted by Ba1ley View Post
    The formula itself will on tab '2013' in cell 'B140' and when devised correctly dragged all the way across to 'BB140'
    OK, try this...

    Entered in cell B140 and copied across as needed:

    =COUNTA(INDIRECT("'"&COLUMNS($B140:B140)&"'!C10:H10"))

  9. #9
    Registered User
    Join Date
    04-18-2013
    Location
    Staffs
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: How to drag a formula increasing tab number only?

    Tony you are a genius That works a treat thank you very much!

    I don't suppose you could recommend a book for learning Excel? I've picked up bits and bobs over the years but nothing in comparison to what there is to learn, I must say I'm very keen to learn more.

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

    Re: How to drag a formula increasing tab number only?

    There's a good list of books here:

    http://contextures.com/xlbooks.html

    Another good way to learn...

    If you can "invest" a few hours every day in forums like this one reading posts and studying the solutions and with lots of experimentation, in 4 or 5 years you'll be an Excel Guru!

  11. #11
    Registered User
    Join Date
    04-18-2013
    Location
    Staffs
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: How to drag a formula increasing tab number only?

    Thanks for the link, it's pay day a week on Monday so I'll have to invest some of my hard earned!

    I'll be sure to stick around on the forum too, I didn't realise how much I had to learn. I am keen though

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

    Re: How to drag a formula increasing tab number only?

    Good deal. Thanks for the feedback!

  13. #13
    Registered User
    Join Date
    04-18-2013
    Location
    Staffs
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: How to drag a formula increasing tab number only?

    Hey Tony, is it possible to make the formula only count cells with a number greater than 0?

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

    Re: How to drag a formula increasing tab number only?

    Like this:

    =COUNTIF(INDIRECT("'"&COLUMNS($B140:B140)&"'!C10:H10"),">0")

  15. #15
    Registered User
    Join Date
    04-18-2013
    Location
    Staffs
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: How to drag a formula increasing tab number only?

    Absolutely superb, thanks again!

    I was having a play around with it myself before I asked for help and I wasn't a million miles away. I suppose it will all become clearer once I understand the symbols a little better.

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

    Re: How to drag a formula increasing tab number only?

    You're welcome!

+ 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.6.0 RC 1