+ Reply to Thread
Results 1 to 4 of 4

Search array for certain text then count occurrences of different text in only rows above

  1. #1
    Registered User
    Join Date
    07-14-2010
    Location
    Hot Springs, AR
    MS-Off Ver
    2010
    Posts
    38

    Search array for certain text then count occurrences of different text in only rows above

    Consider the below data. For example, I want to search for "ghi" (will occur only once) in an array (A1:D5 here, much larger in actual data), then count the number of times E occurs in the 4 rows above in same column. I've used VLOOKUP going horizontally, but this is vertically. I've tried HLOOKUP with no luck and maybe that's totally off base.

    ColA ColB ColC ColD
    Row1 A E A E
    Row2 B F B F
    Row3 D E A F
    Row4 D H D H
    Row5 def ghi jkl mnp

    Thanks,
    roothog
    Last edited by roothog; 01-09-2013 at 07:53 PM.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Search array for certain text then count occurrences of different text in only rows ab

    Assuming you know that "ghi" will appear somewhere in A5:D5 try this

    =COUNTIF(INDEX(A1:D4,0,MATCH("ghi",A5:D5,0)),"E")

    that should return 2 for your example ("E"s in B1:B4)
    Audere est facere

  3. #3
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Search array for certain text then count occurrences of different text in only rows ab

    Ignore this post

  4. #4
    Registered User
    Join Date
    07-14-2010
    Location
    Hot Springs, AR
    MS-Off Ver
    2010
    Posts
    38

    Re: Search array for certain text then count occurrences of different text in only rows ab

    Thanks, daddylonglegs, your formula worked...across several hundred columns in my worksheet!

+ 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