+ Reply to Thread
Results 1 to 9 of 9

formula to search and analyse.

  1. #1
    Registered User
    Join Date
    06-03-2008
    Posts
    14

    formula to search and analyse.

    I'm in the process of trying to make a worksheet to analyse the data in 12 other sheets by input.

    Basically put, there are 10 variables (1-10 in text form with the '/' character in them) which need to be searched in 12 worksheets (named in months jan - dec) .

    I need the formula to search all of the worksheets and every time it finds the searched character string, if data is in one column (profit), add it to the result but if in another column (loss) ignore it.

    I also need another formula, similar to this one, to add all of the searched items together i.e. search ten/ and the there are 8 instances of the input string in the worksheets, therefore the result is 8. Or search twelve/ and there are 24 in the worksheets so the result is 24.

    Is this possible? Anybody clever enough to know how to even start looking at this?

    Recap:

    10 search terms (one/, two/, three/, etc..)
    12 worksheets (Jan, Feb, Mar, Apr, Jun etc...)

    Thanks in advance for any help you can give.

    Darren
    Last edited by bluefrog; 06-03-2008 at 03:29 PM. Reason: Got told off ;)

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Please read the Forum Rules about thread titles, and then edit your thread title to be descriptive of your problem.

  3. #3
    Registered User
    Join Date
    06-03-2008
    Posts
    14
    Sorry Shg, changed to best describe it in my own way. Probably still not right though.

    D

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    I think a sample workbook with some dummy data would help someone make a suggestion.

  5. #5
    Registered User
    Join Date
    06-03-2008
    Posts
    14
    You are right of course. I have now attached a dummy sheet with sample data to just give a feel for what I need to achieve.

    Each sheet (jan - dec) will have data entered into it based on 'variable' names, one/1 two/2 etc... upto 10. Basically what needs to happen is that a formula needs to check each worksheet for the occurance of the 'variable' and if present check the profit & loss columns to see what data is there. And if the data is in profit add one to the P column on the analytics sheet for the 'variable' and month or in loss add one to the L column under the same rules.

    So based on this the following 3 months would read:

    JAN=
    one/1=1 (p column)
    two/2=2 (p column)
    three/3=1 (p column)
    four/4=0
    five/5=1 (p column)
    six/6=1 (p column) & 1 (L column)
    seven/7=1 (p column)
    eight/8=0
    nine/9=0
    ten/10=3 (L column)

    FEB=
    one/1=1 (p column) & 1 (L column)
    two/2=3 (p column)
    three/3=2 (p column) & 3 (L column)
    four/4=3 (p column) & 1 (L column)
    five/5=0
    six/6=0
    seven/7=0
    eight/8=0
    nine/9=0
    ten/10=0

    MAR=
    one/1=0
    two/2=0
    three/3=0
    four/4=1 (L column)
    five/5=1 (L column)
    six/6=2 (p column) & 2 (L column)
    seven/7=0
    eight/8=3 (P column)
    nine/9=4 (L column)
    ten/10=0

    See attached worksheet for verification. I'm not sure if a vlookup & count would work? Not sure it would based on possible multiple rows.

    Thanks in advance.

    Darren
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    06-03-2008
    Posts
    14
    Anybody even got an idea where to start with this?

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    In Analytics!B5: =SUMPRODUCT( (INDIRECT($A5 & "!d2:d31") = B$3) * (INDIRECT($A5 & "!f2:f31") > 0) )

    In Analytics!C5: =SUMPRODUCT( (INDIRECT($A5 & "!d2:d31") = B$3) * (INDIRECT($A5 & "!g2:g31") > 0) )

    Select those two cells, and then drag them right and down.

  8. #8
    Registered User
    Join Date
    06-03-2008
    Posts
    14
    Thanks, that works perfectly. I assumed it would have been more complicated than that.

    Thank you.

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    You're welcome, glad it worked for you.

+ 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