+ Reply to Thread
Results 1 to 19 of 19

Making a cell equal either one of two cells

  1. #1
    Registered User
    Join Date
    09-07-2015
    Location
    the Netherlands
    MS-Off Ver
    2010
    Posts
    21

    Making a cell equal either one of two cells

    Hi everyone,

    I am having trouble with a formula in excel 2010.
    I have a cell (F657) that I want to be equal to either cell F340 or F235, depending on which of these two cells is not blank.
    Both F340 and F235 are dependent on other cells (F351 or F247) and are blank if those cells are empty.

    Can anyone provide me with the right formula to do this?

    I hope my explanation is clear enough.

    Many thanks in advance!
    Last edited by Wiggle12; 09-16-2015 at 09:11 AM.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Making a cell equal either one of two cells

    Hi,

    Assuming that one will always be populated and the other always blank:

    =MAX(F340,F235)
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    09-07-2015
    Location
    the Netherlands
    MS-Off Ver
    2010
    Posts
    21

    Re: Making a cell equal either one of two cells

    Hi sweep,

    Thank you very much for your quick reply!

    Initially both cells will be blank. Then based on the information that is added to the excel document certain cells will contain values.
    Do you know how I can change the formula so that F657 will be blank if F340 and F235 are blank?

    Furthermore, in F656 I will have to insert the WORKDAY formula. So F656 will be equal to WORKDAY(F657;-E657;F13:F25) if F340 contains a value and otherwise be equal to WORKDAY(F235;-E235;F13:F25) if F235 contains a value.

    Do you know how I could best formulate that?

  4. #4
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Making a cell equal either one of two cells

    Do you know how I can change the formula so that F657 will be blank if F340 and F235 are blank?
    Yes, like this:

    =IF(AND(ISBLANK(F340),ISBLANK(F235)),"",MAX(F340,F235))

    F656 will be equal to WORKDAY(F657;-E657;F13:F25) if F340 contains a value and otherwise be equal to WORKDAY(F235;-E235;F13:F25) if F235 contains a value.
    What's the requirement if both F340 and F235 contain values?

  5. #5
    Registered User
    Join Date
    09-07-2015
    Location
    the Netherlands
    MS-Off Ver
    2010
    Posts
    21

    Re: Making a cell equal either one of two cells

    Hi sweep,

    Thank you!

    There is no possibility for both F340 and F235 to contain a value. There will always be one that is blank.

  6. #6
    Registered User
    Join Date
    09-07-2015
    Location
    the Netherlands
    MS-Off Ver
    2010
    Posts
    21

    Re: Making a cell equal either one of two cells

    Right now the value in cell F657 is saturday 0 january 1990. Cell F340 and F235 are blank, but do contain a formula. Do you know what I should change about the formula to have cell F657 be blank when cell F340 and F235 are blank?

  7. #7
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Making a cell equal either one of two cells

    Can you try these?

    F656=IF(NOT(ISBLANK(F340)),WORKDAY(F657,-E657,F13:F25),WORKDAY(F235,-E235,F13:F25))

    F657=IF(AND(F340="",F235=""),"",MAX(F340,F235))

  8. #8
    Registered User
    Join Date
    09-07-2015
    Location
    the Netherlands
    MS-Off Ver
    2010
    Posts
    21

    Re: Making a cell equal either one of two cells

    The first one does not work. The second one does!

  9. #9
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Making a cell equal either one of two cells

    Ok, so we're getting there......when you say it doesn't work, what does it do?

  10. #10
    Registered User
    Join Date
    09-07-2015
    Location
    the Netherlands
    MS-Off Ver
    2010
    Posts
    21

    Re: Making a cell equal either one of two cells

    Hi sweep,

    Sorry for the late reply.
    It says #VALUE!

  11. #11
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Making a cell equal either one of two cells

    Very odd. It works for me. That suggests that there is non numeric data in one of the referenced cells.


    What do

    =WORKDAY(F657,-E657,F13:F25)
    =WORKDAY(F235,-E235,F13:F25)

    give you?

    What values are in cells F657,E657,F13:F25,F235,E235?

  12. #12
    Registered User
    Join Date
    09-07-2015
    Location
    the Netherlands
    MS-Off Ver
    2010
    Posts
    21

    Re: Making a cell equal either one of two cells

    I missed a notification for this.

    Those formulas also give me #VALUE!, which I don't understand because they worked just fine before.

    All of the relevant cells in E and F (will) contain dates. F13:F25 represent the holidays we have. Any cell in column F represent a deadline, whereas any cell in column E represents the number of days. F657 is equal to the date in F235 or F340. F656 will equal the date represent in F657 minus the number of days taken (represented in cell E657).

  13. #13
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Making a cell equal either one of two cells

    Sounds like you have text in one of the cells. Can you post the sheet so we can take a look at it?

  14. #14
    Registered User
    Join Date
    09-07-2015
    Location
    the Netherlands
    MS-Off Ver
    2010
    Posts
    21

    Re: Making a cell equal either one of two cells

    Hi sweep,

    Unfortunately the sheet is confidential so I can't post it. I just checked again, and I don't have any text in these cells, so I have no idea what the problem is..

  15. #15
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Making a cell equal either one of two cells

    I'm not sure I can help any further in that case. As a final investigation, you could use the =ISNUMBER() function to test all the cells.

  16. #16
    Registered User
    Join Date
    09-07-2015
    Location
    the Netherlands
    MS-Off Ver
    2010
    Posts
    21

    Re: Making a cell equal either one of two cells

    Alright, thank you. I will give it a try!

  17. #17
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Making a cell equal either one of two cells

    Quote Originally Posted by sweep View Post
    Sounds like you have text in one of the cells.
    Yes they do, because
    Quote Originally Posted by Wiggle12 View Post
    Cell F340 and F235 are blank, but do contain a formula.
    If a cell contains a formula, it CANNOT be blank.
    A formula returning "" is NOT blank. It's a TEXT string

    So If F657 contains
    Quote Originally Posted by sweep View Post
    F657=IF(AND(F340="",F235=""),"",MAX(F340,F235))
    And both F340 and F235 are "", then that formula also returns ""

    So this will error because ISBLANK(F340) is FALSE.
    So it uses F657 in the Workday. F657 = "" as well, so the Workday function is #Value! error.
    Quote Originally Posted by sweep View Post
    F656=IF(NOT(ISBLANK(F340)),WORKDAY(F657,-E657,F13:F25),WORKDAY(F235,-E235,F13:F25))
    Try
    =IF(COUNT(F340,F235)=0,"",IF(ISNUMBER(F340),WORKDAY(F657,-E657,F13:F25),WORKDAY(F235,-E235,F13:F25)))

  18. #18
    Registered User
    Join Date
    09-07-2015
    Location
    the Netherlands
    MS-Off Ver
    2010
    Posts
    21

    Re: Making a cell equal either one of two cells

    Thank you Jonmo1, that works!

  19. #19
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Making a cell equal either one of two cells

    You're welcome.

+ 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. Making two formulae cells equal each other (have 3 variables that can change)
    By Toni Jo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-05-2014, 09:10 AM
  2. Replies: 5
    Last Post: 06-10-2014, 01:57 PM
  3. Making multiple cells equal to other cells
    By forrestcupp in forum Excel General
    Replies: 5
    Last Post: 12-31-2013, 03:19 PM
  4. Making A Letter Equal A Word In Another Cell
    By Rangoth in forum Excel General
    Replies: 8
    Last Post: 03-18-2013, 06:17 AM
  5. making #N/A equal a number?
    By brandon in forum Excel General
    Replies: 3
    Last Post: 03-20-2008, 10:33 AM
  6. Replies: 3
    Last Post: 11-16-2007, 10:16 AM
  7. Making Chart Titles equal Cell Contents
    By JohnGuts in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 04-27-2007, 03:01 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