+ Reply to Thread
Results 1 to 9 of 9

Formular to type text into a cell depending on data in 2 other cells

Hybrid View

  1. #1
    Registered User
    Join Date
    07-02-2013
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    8

    Formular to type text into a cell depending on data in 2 other cells

    Hi All,

    Hope you can help. I am looking for formular that will type some text into a cell, depending on what is written in 2 other cells on a different sheet. so for example.

    If on Sheet 3 Cell A2 the cell contains the words "Standard Perils" and on Sheet 3 Cell B2 the cell contains the words "Not Covered" then on sheet 1 Cell W2 i want it to input the words ""Standard Buildings".

    Is this possible?

    Thanks in advance.
    Nick

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Formular to type text into a cell depending on data in 2 other cells

    =IF(AND(Sheet3!A2="Standard Perils",Sheet3!B2="Not Covered"),"StandardBuildings","")

    ??
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Formular to type text into a cell depending on data in 2 other cells

    in Sheet 1 W2 use

    =IF(AND(COUNTIF(Sheet3!A2,"*Standard Perils*"),COUNTIF(Sheet3!B2,"*Not covered*")),"Standard Buildings","")
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  4. #4
    Registered User
    Join Date
    07-02-2013
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Formular to type text into a cell depending on data in 2 other cells

    Hi Fortis,

    That's fantastic and has worked, thank you so much. Now however just to be annoying i need to go a bit further.

    Could i extend the formular to Type into my cell a different word, if the text in Cells A2 and B2 of sheet 3 are different, so for example:-

    If on Sheet 3 Cell A2 the cell contains the words "Standard Perils" and on Sheet 3 Cell B2 the cell contains the words "Not Covered" then on sheet 1 Cell W2 i want it to input the words ""Standard Buildings" OR If on Sheet 3 Cell A2 the cell contains the words "Standard Perils" and on Sheet 3 Cell B2 the cell contains the words "Standard Perils" then on sheet 1 Cell W2 i want it to input the words ""Standard Buildings and Standard Contents"?

    Really appreciate your help, thank you soooo much!!!

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Formular to type text into a cell depending on data in 2 other cells

    =IF(AND(Sheet3!A2="Standard Perils",Sheet3!B2="Not Covered"),"StandardBuildings",IF(AND(Sheet3!A2="Standard Perils",Sheet3!B2="Standard Perils"),"Standard Buildings and Standard Contents",""))

  6. #6
    Registered User
    Join Date
    07-02-2013
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Formular to type text into a cell depending on data in 2 other cells

    That Sir, is amazing!

    I have followed that and it has worked.

    if i wanted to add to it (There are potentially 8 different combinations i need), do i just copy and past from the start of the second "IF" to the " and the end of 'Standard Contents' and replace the words with the different words? E.g. below:-

    =IF(AND(Sheet3!A2="Standard Perils",Sheet3!B2="Not Covered"),"StandardBuildings",IF(AND(Sheet3!A2="Standard Perils",Sheet3!B2="Standard Perils"),"Standard Buildings and Standard Contents"IF(AND(Sheet3!A2="Standard Perils",Sheet3!B2="Accidental Damage"),"Standard Buildings and Contents with AD"IF(AND(Sheet3!A2="Not Covered",Sheet3!B2="Standard Perils"),"Standard Contents",""))

    And so on?

    Thanks again.

  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Formular to type text into a cell depending on data in 2 other cells

    This is 1 way to go(be careful with comma separators...)

    Perhaps you can use a table with all posible answers and then use an INDEX&MATCH, to avoid the multiply if(and...

  8. #8
    Registered User
    Join Date
    07-02-2013
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Formular to type text into a cell depending on data in 2 other cells

    Hi,

    That's fine, i will have a look at what INDEX&MATCH table is!

    Sorry, as you may have guessed i am a novice on excel and need to work on a project!

    Thanks a lot.

  9. #9
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Formular to type text into a cell depending on data in 2 other cells

    ........................

+ 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