Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Excel - How do I populate a cell depending on the value in another cell

  • 05-04-2007 02:54PM
    #1
    Registered Users, Registered Users 2 Posts: 1,379 ✭✭✭


    Excel – How do I populate a cell depending on the value in another cell


    Wondering if someone can help me with this.

    In a worksheet I want to populate the value in a cell depending on the values in other cells on other worksheets.

    Something like

    IF (Worksheet_1 Cell_A OR Woorksheet_2 Cell_A OR Worksheet_n Cell A) = ‘1’ THEN ‘X’

    I’m sure it’s fairly easy, just can’t get my head around it on a sunny Thursday evening


Comments

  • Closed Accounts Posts: 2,023 ✭✭✭zod


    maybe lookup


  • Registered Users, Registered Users 2 Posts: 3,311 ✭✭✭xebec


    Also check the syntax of your IF statements.

    =IF(Worksheet_1_Cell_A = "1","X","Something else")

    You can embed IF statements, so for example if the above weren't true, then in the "Something else" bit you could put another IF to check Worksheet 2 and so on.

    Not sure how you would reference cells in different worksheets, ignore that bit of my example because it's there just to illustrate the point.


  • Registered Users, Registered Users 2 Posts: 4,787 ✭✭✭prospect


    I would suggest a vlookup or hlookup function is your answer.


  • Registered Users, Registered Users 2 Posts: 23,202 ✭✭✭✭Tom Dunne


    If statement is your only man for this job.

    xebec gives the correct format of the if statement. To reference a cell on another sheet, you use the format <sheetname>!<cell reference>, so the if statement becomes:

    = =IF(Sheet2!C4 = "1","X","Something else")

    obviously replacing Sheet2 and C4 with the relevant values.

    To back up what xebec says about multiple if statements, you could end up with something wonderful like

    =IF(sheet1!A1 = "1","X", IF(Sheet1!A2 = "1","X",IF(Sheet2!C4 = "1","X","Something else"))))

    and so on. Fun.


Advertisement