+ Reply to Thread
Results 1 to 8 of 8

Formula not working correctly when a cell is being populated by another formula

  1. #1
    Registered User
    Join Date
    01-28-2013
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    8

    Formula not working correctly when a cell is being populated by another formula

    Hi All,

    Can't work this one out so looking for some advice, (or more accurately for someone to tell me what idiotic thing I'm doing)!

    So I have a formula for a football, (soccer), prediction sheet. This compares the predicted result to the actual result and awards a set number of points based on the comparison. It goes wrong when a number is entered in either B5 or C5 that isn't directly input by myself, IE a formula generates the number. This only fails on the last part of the formula below.

    For example:

    B5=actual home team score, C5=actual away team score, F5=predicted home teams core, G5=predicted away team score

    =IF(AND(B5=C5,B5=F5,B5=G5),4,IF(B5&C5=F5&G5,3,IF(AND(B5=C5,F5=G5),1,IF(AND(B5>C5,F5>G5),1,IF(AND(B5<C5,F5<G5),1,IF(OR(B5=F5,C5=G5),2,0))))))

    Correct draw prediction for both teams = 4 points: IF(AND(B5=C5,B5=F5,B5=G5),4
    Not a draw and correct score prediction for both teams = 3 points: IF(B5&C5=F5&G5,3
    Home win with home win predicted but not correct scorw = 1 point: IF(AND(B5>C5,F5>G5),1
    Away win with away win predicted but not correct score = 1 point: IF(AND(B5<C5,F5<G5),1
    Incorrect guess but got 1 of the teams goals correct = 2 points: IF(OR(B5=F5,C5=G5),2 - this is what fails with formula generated numbers
    Anything else is 0 points

    So as long as I enter actual numbers in cells B5 and C5 this works great, but as soon as I set B5 and C5 to automatically produce the numbers the last part of the formula fails, IF(OR(B5=F5,C5=G5),2

    The rest of the formula works fine no matter what I do with the cells, just that last bit!

    I have now spent waaay to long on this so need some advice. Cheers

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,950

    Re: Formula not working correctly when a cell is being populated by another formula

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook.

    Are you really still using Excel 2003?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    01-28-2013
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    8

    Re: Formula not working correctly when a cell is being populated by another formula

    Hi Ali,

    Demo excel sheet attached. Thanks for the heads up.
    I'm using a later version of Excel but I'm a very rusty and old school user .

    Cheers
    Attached Files Attached Files
    Last edited by AliGW; 07-23-2021 at 10:49 AM. Reason: PLEASE don't quote unnecessarily!

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,950

    Re: Formula not working correctly when a cell is being populated by another formula

    Which version are you using? Please update your forum profile accordingly. It may well be significant.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,950

    Re: Formula not working correctly when a cell is being populated by another formula

    You are trying to compare numbers with text.

    Change formulae thus:

    =--LEFT(E8)

    =--RIGHT(E8)

  6. #6
    Registered User
    Join Date
    01-28-2013
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    8

    Re: Formula not working correctly when a cell is being populated by another formula

    Wow that's amazing. What difference does the -- make?
    Last edited by AliGW; 07-23-2021 at 11:01 AM. Reason: PLEASE don't quote unnecessarily!

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,950

    Re: Formula not working correctly when a cell is being populated by another formula

    It turns text into a number.

    I asked you to update your profile - please do so now.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  8. #8
    Registered User
    Join Date
    01-28-2013
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    8

    Re: Formula not working correctly when a cell is being populated by another formula

    Yep I'll do all of that. Thanks for the help!
    Last edited by AliGW; 07-23-2021 at 11:18 AM. Reason: PLEASE don't quote unnecessarily!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] IF(AND( Formula not working correctly
    By Chris McGlothen in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-18-2020, 05:10 PM
  2. [SOLVED] substitute formula not working correctly on a specific date formula
    By jrtaylor in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-27-2019, 11:54 AM
  3. [SOLVED] INT Formula Not Working Correctly
    By chrisbay2324 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-20-2018, 09:59 AM
  4. [SOLVED] Formula not working out correctly
    By ladbroke in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 06-26-2015, 01:24 AM
  5. If then formula not working correctly
    By chappie97 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-23-2013, 01:22 AM
  6. [SOLVED] IF formula not working correctly
    By ErikaC in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-18-2013, 03:38 PM
  7. Replies: 9
    Last Post: 03-08-2013, 11:50 AM

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