+ Reply to Thread
Results 1 to 13 of 13

Countif and indirect formula

Hybrid View

  1. #1
    Registered User
    Join Date
    09-01-2014
    Location
    England
    MS-Off Ver
    2013
    Posts
    6

    Question Countif and indirect formula

    So basically I am creating a database of football statistics to include corners, goals, possession etc.
    I am concentrating on many leagues around the world and for each team I am doing a seperate tab, so there will be many tabs.

    For each team in the premier league for example, each tab is known as PL1, PL2, PL3 etc.

    I need the same formula on a statistics tab for each of the teams.

    Arsenal for example are known this season as PL1.

    For a formula to count how many games they have won I have this formula: =COUNTIF('PL1'!$T$9:$T$28,"WIN")

    When I drag down to the new cell, I need the PL1 to change to the next tab which will be PL2.


    I have tried so many different formulas and I just can't seem to get it right. Someone out there must know the answer!

    Thanks a million!

    Danfranco.
    Last edited by JBeaucaire; 09-01-2014 at 07:47 PM. Reason: Corrected Thread Title.

  2. #2
    Forum Contributor
    Join Date
    03-17-2005
    Location
    Canterbury, Kent
    MS-Off Ver
    2003, 2010
    Posts
    285

    Re: Please help me im going crazy!!! Countif and indirect formula?

    You could use a helper column next to the team names with the sheet name for example: Pl1 Arsenal then you could use this formula: =COUNTIF(INDIRECT("'"&C1&"'!$T$9:$T$28"),"WIN") Change the C1 to your helper column.

    Windy

  3. #3
    Registered User
    Join Date
    09-01-2014
    Location
    England
    MS-Off Ver
    2013
    Posts
    6

    Re: Please help me im going crazy!!! Countif and indirect formula?

    I don't understand this really. I just want it to change tabs when I drag it down? I dont get where C1 is coming from.

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Please help me im going crazy!!! Countif and indirect formula?

    Read the forumrules, especialy the ones about crossposting.

    http://www.mrexcel.com/forum/excel-q...t-formula.html
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  5. #5
    Registered User
    Join Date
    09-01-2014
    Location
    England
    MS-Off Ver
    2013
    Posts
    6

    Re: Please help me im going crazy!!! Countif and indirect formula?

    Are they classed as the same website?

  6. #6
    Forum Contributor
    Join Date
    03-17-2005
    Location
    Canterbury, Kent
    MS-Off Ver
    2003, 2010
    Posts
    285

    Re: Please help me im going crazy!!! Countif and indirect formula?

    see attached example
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    09-01-2014
    Location
    England
    MS-Off Ver
    2013
    Posts
    6

    Re: Please help me im going crazy!!! Countif and indirect formula?

    Quote Originally Posted by windy58 View Post
    see attached example
    Thanks Windy but I think we have our wires crossed here.

    Let me try and explain.

    So I have a football database.

    Each team within this database have a worksheet specifically for them. Arsenal are in PL1. Aston Villa in PL2.
    On worksheet PL1, I have a table to show arsenal's stats for each of their games against other teams. This shows goals, corners, cards, ht result, who scored first etc.

    I also have different worksheets for each stat, so one for cards, corners etc.

    For the one I have that is HT result, I have to calculated how many games Arsenal have won at half time from the ones they have played.

    In cell M7 on that page I have the following formula to do this: =COUNTIF('PL1'!$T$9:$T$28,"WIN")

    In cell M8 on that worksheet, I want to do the same thing for Aston Villa who are on worksheet PL2.

    Instead of going down each cell and changing PL1 to PL2, PL3 etc, I want to just be able to drag the cell down so it does this for me.

    Sorry its abit of a nightmare.

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Please help me im going crazy!!! Countif and indirect formula?

    Are they classed as the same website?

    No, and that is why it is called crossposting.

  9. #9
    Registered User
    Join Date
    09-01-2014
    Location
    England
    MS-Off Ver
    2013
    Posts
    6

    Re: Please help me im going crazy!!! Countif and indirect formula?

    So why does it matter that I posted this on another website under another account?

  10. #10
    Forum Contributor
    Join Date
    03-17-2005
    Location
    Canterbury, Kent
    MS-Off Ver
    2003, 2010
    Posts
    285

    Re: Please help me im going crazy!!! Countif and indirect formula?

    can you upload a sample workbook?

  11. #11
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Please help me im going crazy!!! Countif and indirect formula?

    So why does it matter that I posted this on another website under another account?
    First, because the forumrules are for every member on the forum, so also for you.

    Second, more important, see the link below.


    http://www.excelguru.ca/content.php?184

  12. #12
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Countif and indirect formula

    Your thread title was inappropriate and you crossposted...two no-nos in a single thread.

    When you joined the forum recently you agreed to abide by the Forum Rules, but in haste I fear you might not have actually read them. Please stop and take a moment to read them now. We all follow these rules for the benefit of all, as must you. Thanks.

    (link above in the menu bar)
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  13. #13
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Thumbs up Re: Countif and indirect formula

    Try this ..
    No need of helper columns
    Formula: copy to clipboard
    =COUNTIF(INDIRECT("'PL"&Row($A1)&"'!$T$9:$T$28"),"WIN")

    Drag Down...
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

+ 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. [SOLVED] Adding Indirect formula to a Countif
    By nikkilynn2 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-03-2014, 08:24 PM
  2. [SOLVED] 2 data Range using COUNTIF with INDIRECT and MIN IF with INDIRECT,
    By david gonzalez in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 11-29-2013, 08:10 PM
  3. [SOLVED] Countif function goes crazy
    By ANS in forum Excel Formulas & Functions
    Replies: 29
    Last Post: 08-04-2013, 04:55 AM
  4. Help I am going crazy with this formula.
    By laz in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-10-2005, 06:22 PM
  5. Crazy formula
    By swmasson in forum Excel General
    Replies: 8
    Last Post: 03-04-2005, 05:04 AM

Tags for this Thread

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