+ Reply to Thread
Results 1 to 6 of 6

Using a value from a cell inside a formula!

  1. #1
    Registered User
    Join Date
    11-15-2003
    Location
    Oslo, Norway
    MS-Off Ver
    2010
    Posts
    11

    Using a value from a cell inside a formula!

    Hi!

    I've got two cells that contain the start and end row of a matrix in a sheet.

    I want to use these row numbers in a =COUNT.IF formula to count the number of specified instances in this matrix.

    But my problem is this; how can I use the values in the two cells inside the COUNT.IF formula??

    I should look something like this;

    =COUNT.IF(F"cell1":F"cell2";"=argument")

    As you can see, the column (F) is specified in the formula but the row number needs to be fetched from cell1 and cell2.

    Can anyone help me with the correct syntax?

    Thanks!

    -M-

  2. #2
    Registered User
    Join Date
    08-22-2005
    Location
    Surrey, UK
    Posts
    11
    Quote Originally Posted by marsupilami
    Hi!

    I've got two cells that contain the start and end row of a matrix in a sheet.

    I want to use these row numbers in a =COUNT.IF formula to count the number of specified instances in this matrix.

    But my problem is this; how can I use the values in the two cells inside the COUNT.IF formula??

    I should look something like this;

    =COUNT.IF(F"cell1":F"cell2";"=argument")

    As you can see, the column (F) is specified in the formula but the row number needs to be fetched from cell1 and cell2.

    Can anyone help me with the correct syntax?

    Thanks!

    -M-
    Use an INDIRECT function and concatenate with the &

    eg you can refer to a cell as follows

    =indirect("A" & B23 & ":A" & B24)

    so your formula would look something like

    =countif(Indirect("F" & cell1 & ":F" & cell2, argument))

  3. #3
    bj
    Guest

    RE: Using a value from a cell inside a formula!

    try
    =countif(offset(indirect("F:"&cell1),0,0,cell2-cell1+1),"argument")

    "marsupilami" wrote:

    >
    > Hi!
    >
    > I've got two cells that contain the start and end row of a matrix in a
    > sheet.
    >
    > I want to use these row numbers in a =COUNT.IF formula to count the
    > number of specified instances in this matrix.
    >
    > But my problem is this; how can I use the values in the two cells
    > inside the COUNT.IF formula??
    >
    > I should look something like this;
    >
    > =COUNT.IF(F"cell1":F"cell2";"=argument")
    >
    > As you can see, the column (F) is specified in the formula but the row
    > number needs to be fetched from cell1 and cell2.
    >
    > Can anyone help me with the correct syntax?
    >
    > Thanks!
    >
    > -M-
    >
    >
    > --
    > marsupilami
    > ------------------------------------------------------------------------
    > marsupilami's Profile: http://www.excelforum.com/member.php...fo&userid=2698
    > View this thread: http://www.excelforum.com/showthread...hreadid=398110
    >
    >


  4. #4
    Bob Phillips
    Guest

    Re: Using a value from a cell inside a formula!

    =COUNTIF(INDIRECT("F"&cell1&":F"&cell2),"argument")

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "marsupilami" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Hi!
    >
    > I've got two cells that contain the start and end row of a matrix in a
    > sheet.
    >
    > I want to use these row numbers in a =COUNT.IF formula to count the
    > number of specified instances in this matrix.
    >
    > But my problem is this; how can I use the values in the two cells
    > inside the COUNT.IF formula??
    >
    > I should look something like this;
    >
    > =COUNT.IF(F"cell1":F"cell2";"=argument")
    >
    > As you can see, the column (F) is specified in the formula but the row
    > number needs to be fetched from cell1 and cell2.
    >
    > Can anyone help me with the correct syntax?
    >
    > Thanks!
    >
    > -M-
    >
    >
    > --
    > marsupilami
    > ------------------------------------------------------------------------
    > marsupilami's Profile:

    http://www.excelforum.com/member.php...fo&userid=2698
    > View this thread: http://www.excelforum.com/showthread...hreadid=398110
    >




  5. #5
    RagDyer
    Guest

    Re: Using a value from a cell inside a formula!

    Another way, which I believe, is non-volatile:

    =COUNTIF(INDEX(F:F,Cell1):INDEX(F:F,Cell2),argument)

    --
    HTH,

    RD
    ==============================================
    Please keep all correspondence within the Group, so all may benefit!
    ==============================================


    "marsupilami" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Hi!
    >
    > I've got two cells that contain the start and end row of a matrix in a
    > sheet.
    >
    > I want to use these row numbers in a =COUNT.IF formula to count the
    > number of specified instances in this matrix.
    >
    > But my problem is this; how can I use the values in the two cells
    > inside the COUNT.IF formula??
    >
    > I should look something like this;
    >
    > =COUNT.IF(F"cell1":F"cell2";"=argument")
    >
    > As you can see, the column (F) is specified in the formula but the row
    > number needs to be fetched from cell1 and cell2.
    >
    > Can anyone help me with the correct syntax?
    >
    > Thanks!
    >
    > -M-
    >
    >
    > --
    > marsupilami
    > ------------------------------------------------------------------------
    > marsupilami's Profile:

    http://www.excelforum.com/member.php...fo&userid=2698
    > View this thread: http://www.excelforum.com/showthread...hreadid=398110
    >



  6. #6
    Registered User
    Join Date
    11-15-2003
    Location
    Oslo, Norway
    MS-Off Ver
    2010
    Posts
    11

    Problem solved!

    Thanks alot guys!

    -M-

+ 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