+ Reply to Thread
Results 1 to 6 of 6

Changing a cell reference within a formula w/another cell

  1. #1
    Registered User
    Join Date
    06-29-2005
    Posts
    77

    Changing a cell reference within a formula w/another cell

    Hi

    Let's say I have this formula in A1:

    =if(A2=2,"Hello","")

    But let's say I want to make the location of where the '2' has to be to trigger the 'Hello' in A1 conditioned on a value in B1, and let's say B1 changes to 5. So now instead of the formula in A1 saying =if(A2=2,"Hello","") I will want it to say =if(A5=2,"Hello","").

    Many thanks as always

    tx

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486
    I am confused, are you asking for 2 formulas in one cell, this can be done I just want to be sure that is what you are asking:
    for example
    =if(A2=2,"Hello",if(A5=2,"Hello",""))
    Is this what you mean??

  3. #3
    CLR
    Guest

    Re: Changing a cell reference within a formula w/another cell

    =IF(INDIRECT("A"&B1)=2,"Hello","")

    Vaya con Dios,
    Chuck, CABGx3


    "tx12345" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi
    >
    > Let's say I have this formula in A1:
    >
    > =if(A2=2,"Hello","")
    >
    > But let's say I want to make the location of where the '2' has to be to
    > trigger the 'Hello' in A1 conditioned on a value in B1, and let's say B1
    > changes to 5. So now instead of the formula in A1 saying
    > =if(A2=2,"Hello","") I will want it to say =if(A5=2,"Hello","").
    >
    > Many thanks as always
    >
    > tx
    >
    >
    > --
    > tx12345
    > ------------------------------------------------------------------------
    > tx12345's Profile:

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




  4. #4
    Registered User
    Join Date
    06-29-2005
    Posts
    77
    CLR

    Works great, thank you.

    tx

  5. #5
    Max
    Guest

    Re: Changing a cell reference within a formula w/another cell

    One way, think we could use in A1:
    =IF(INDIRECT("A"&B1)=2,"Hello","")
    where B1 will contain the row reference
    --
    Max
    Singapore
    http://savefile.com/projects/236895
    xdemechanik
    ---
    "tx12345" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi
    >
    > Let's say I have this formula in A1:
    >
    > =if(A2=2,"Hello","")
    >
    > But let's say I want to make the location of where the '2' has to be to
    > trigger the 'Hello' in A1 conditioned on a value in B1, and let's say B1
    > changes to 5. So now instead of the formula in A1 saying
    > =if(A2=2,"Hello","") I will want it to say =if(A5=2,"Hello","").
    >
    > Many thanks as always
    >
    > tx
    >
    >
    > --
    > tx12345
    > ------------------------------------------------------------------------
    > tx12345's Profile:

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




  6. #6
    CLR
    Guest

    Re: Changing a cell reference within a formula w/another cell

    You're quite welcome, thanks for the feedback......

    Vaya con Dios,
    Chuck, CABGx3


    "tx12345" <[email protected]> wrote in
    message news:[email protected]...
    >
    > CLR
    >
    > Works great, thank you.
    >
    > tx
    >
    >
    > --
    > tx12345
    > ------------------------------------------------------------------------
    > tx12345's Profile:

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




+ 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