+ Reply to Thread
Results 1 to 4 of 4

Counting with relationships

  1. #1
    Registered User
    Join Date
    07-28-2008
    Location
    Switzerland
    Posts
    19

    Counting with relationships

    Hey. I have a question which I hope someone here can answer. I need a formula which analyzes every cell of a whole sheet and counts for a certain word(WORD1), but only when the cell above this certain word(WORD1) is another specific word (WORD2). For this I think that there would need to be a relationship set up but I don't know how to do this unfortunately. If anyone has any ideas, please help me out. Thanks

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475
    Quote Originally Posted by Horia
    Hey. I have a question which I hope someone here can answer. I need a formula which analyzes every cell of a whole sheet and counts for a certain word(WORD1), but only when the cell above this certain word(WORD1) is another specific word (WORD2). For this I think that there would need to be a relationship set up but I don't know how to do this unfortunately. If anyone has any ideas, please help me out. Thanks
    Hi Horia,
    Can you supply a sample workbook, to explain what you require??

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Here's a way:

    =SUM( (Sheet1!A1:IU99 = "WORD2") * (Sheet1!A2:IU100 = "WORD1") )

    It uses one less than all the columns to keep Excel from converting the range to rows, and only 100 rows because I can't stand making Excel try to do all of them.

    It's an array formula, and so has to be confirmed with Ctrl+Shift+Enter.

    A VBA solution would be better.

  4. #4
    Registered User
    Join Date
    07-28-2008
    Location
    Switzerland
    Posts
    19
    Hey. Thanks for the replies but I found out the formula that i was looking for:

    =SUMPRODUCT(--(Sheet1!$A$2:$F$1500="WORD1");--(Sheet1!$A$1:$F$1499="WORD2"))

+ 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