+ Reply to Thread
Results 1 to 10 of 10

Obtain value of one cell based on value of another cell when both can change

  1. #1
    Registered User
    Join Date
    05-04-2010
    Location
    NSW, Australia
    MS-Off Ver
    Excel 2007
    Posts
    15

    Obtain value of one cell based on value of another cell when both can change

    Hi All

    I have attached a simple spreadsheet to illustrate the problem I need help with.

    I have a group of cells F3:M14 that D3 is the sum of and D5 counts how many of F3:M14 have values in them.

    What I want to be able to do is place the value of D3 into B3,B4,B5, etc when the value of D5 is say 5,10,15, etc

    The version I made the file in (at work) is 2000 but I use 2007 at home
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    04-14-2010
    Location
    california, usa
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Obtain value of one cell based on value of another cell when both can change

    try this

    =IF($D$5=5,$D$3,"")

    just copy down and replace "5" with the value you want

  3. #3
    Registered User
    Join Date
    05-04-2010
    Location
    NSW, Australia
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Obtain value of one cell based on value of another cell when both can change

    srollins13, yes it works in one aspect, but what I was aiming at was trying to get the value that was inserted when D5 was "5" staying there when D5 changed

  4. #4
    Registered User
    Join Date
    05-04-2010
    Location
    NSW, Australia
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Obtain value of one cell based on value of another cell when both can change

    bump no response

  5. #5
    Registered User
    Join Date
    05-04-2010
    Location
    NSW, Australia
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Obtain value of one cell based on value of another cell when both can change

    bump no response

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Obtain value of one cell based on value of another cell when both can change

    You would either need to use Iterative calculations (ie permit circular references) or use VBA - most would opt for the latter.

    If you opt for VBA the obvious question would be: by what means are the values in the matrix updated ?

    The other question pertinent to whichever route you go down - will the number of numeric values in the matrix ever decrease ?
    If so, what happens when the number drops from 5 to 4 - should the existing value for 5 be removed ?

  7. #7
    Registered User
    Join Date
    05-04-2010
    Location
    NSW, Australia
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Obtain value of one cell based on value of another cell when both can change

    Quote Originally Posted by DonkeyOte View Post
    You would either need to use Iterative calculations (ie permit circular references) or use VBA - most would opt for the latter.

    If you opt for VBA the obvious question would be: by what means are the values in the matrix updated ? If I understand the question - Manually

    The other question pertinent to whichever route you go down - will the number of numeric values in the matrix ever decrease ? No
    If so, what happens when the number drops from 5 to 4 - should the existing value for 5 be removed ?
    DonkeyOte, this is an addition to the cricket score sheet you helped me with a few months back, in essence I want the score to be recorded automatically at the end of each over.

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Obtain value of one cell based on value of another cell when both can change

    Using your sample file and the iteration approach (avoiding VBA for time being)

    First clear the matrix of scores
    I am assuming the matrix represents runs conceded per over (not cumulative) and you're looking to get cumulative snapshots in your table on the left

    Second, enable Iteration via Calculation Options (thereby permitting circular references)

    Third, add the formulae to B3:B10 such that:

    B3: =IF(B3,B3,$D$3*($D$5=$A3))
    copied down to B10

    Now as you add values to the OBO matrix you should find that at 5 overs, 10 overs etc the cumulative scores will update (and persist thereafter).

    Assuming my assumptions are correct the other (far simpler) alternative is of course to make the OBO matrix n by 5 such that each row represents a 5 over segment.
    At which point your 5/10/15 table becomes a basic SUM of the appropriate rows.

    To elaborate - assume the OBO matrix is now F3:J14 [ie F3:J3 overs 1 to 5, F4:J4 overs 6 to 10 etc...] then

    B3: =SUM($F$3:$J3)*(COUNT($F$3:$J3)>=$A3)
    copied down to B10

  9. #9
    Registered User
    Join Date
    05-04-2010
    Location
    NSW, Australia
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Obtain value of one cell based on value of another cell when both can change

    I think I did something wrong, didn't work for me.....anyway, if I turn automatic calculation off then all of the other formulas in the score sheet won't work automatically, causing more problems than the need to have this aspect of the score sheet automatic.

  10. #10
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Obtain value of one cell based on value of another cell when both can change

    Who said anything about turning off Auto Calculation ?

    Attached is your sample file with both suggestions in place - the first is using Iteration, the 2nd is using five over blocks.

    When you open this do so in a new instance of Excel
    Attached Files Attached Files

+ 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