+ Reply to Thread
Results 1 to 4 of 4

CountIf question

  1. #1
    Registered User
    Join Date
    07-11-2005
    Posts
    30

    CountIf question

    hello

    i was wondering if i could use the countif function using variables instead of having set constants

    i.e. =countif(R[-2]C[1]:RC[2],""search"")

    but i want = countif(R[VAR1]C:[VAR2]:RC[2],""search"")

    i cant' seem to get the VAR1 part to work..maybe its my equation or maybe i should use a different equation..

    thanks for your help

  2. #2
    Tom Ogilvy
    Guest

    Re: CountIf question

    =countif(indirect("R[" & R1C1 & "]C[" & R1C2 & "]:RC[2]"),"Search")

    Assuming your sheet is in R1C1 mode. R1C1 contains the first Var and R1C2
    contains the second VAR in your example.

    --
    Regards,
    Tom Ogilvy

    "narutard" <[email protected]> wrote in
    message news:[email protected]...
    >
    > hello
    >
    > i was wondering if i could use the countif function using variables
    > instead of having set constants
    >
    > i.e. =countif(R[-2]C[1]:RC[2],""search"")
    >
    > but i want = countif(R[VAR1]C:[VAR2]:RC[2],""search"")
    >
    > i cant' seem to get the VAR1 part to work..maybe its my equation or
    > maybe i should use a different equation..
    >
    > thanks for your help
    >
    >
    > --
    > narutard
    > ------------------------------------------------------------------------
    > narutard's Profile:

    http://www.excelforum.com/member.php...o&userid=25111
    > View this thread: http://www.excelforum.com/showthread...hreadid=386432
    >




  3. #3
    Registered User
    Join Date
    07-11-2005
    Posts
    30
    hi

    i was wondering if it was possibel to declare the countif function w/o using the Range function before it..

    range(something).select
    "=countif(R[" & unknown & "]C[-3]:RC[-3],""SEARCH"")"

    in the previous post there was the word indirect.. i' m not sure what that does but when i took it out ..my countif worked! ..so..i'm not sure whether the "indirect" is essential for what i need to do

    is it possible instead of declaring a range (because i'm using a LOOP already w/ a specified range already) to insert a set of coodinates instead..i.e. the countif function needs somewhere to start LOOKING somewhere

    thanks

  4. #4
    Registered User
    Join Date
    07-11-2005
    Posts
    30
    woah.sorry for triple posting!

    any help would be greatly appreciated

+ 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