+ Reply to Thread
Results 1 to 5 of 5

Excel 2007 : How to make a figure show a value in another cell dependent on a cell with text

  1. #1
    Registered User
    Join Date
    09-22-2011
    Location
    Manchester
    MS-Off Ver
    Excel 2007
    Posts
    13

    How to make a figure show a value in another cell dependent on a cell with text

    How to make a figure show a value in another cell dependent on what line of text is chosen in an another cell?

    In Cell A (Sheet1) I have a drop down menu with "Stock" " Sales "Advertising"

    The drop down menu is on sheet2,
    (Stock= Sheet2!A1)
    (sales=Sheet2!A2)
    (Advertising=Sheet2!A3)

    in cell B is blank but will have a numerical value added when needed.

    I have three columns C, D, E
    C is STock
    D is Sales
    E is Advertising


    If A1 = "stock" and B1 has a value typed in then C1=B1
    but if B1 is left blank then C1 should not have anything in it or equal zero
    and using the formula underneath C1 contains #VALUE when B1 is left blank or "Advertising" or "Sales" is selected in A1


    =IF(FIND("Stock",A1)>0,SUM(B1))
    This formula does the calculation but #VALUE! appears if "Stock" is not selected,
    how can I stop this or equal C1 to 0 if "Stock" is not selected.

    I have been racking my brains for nearly 24 hours and searched many forums please someone put me out of misery and help or at least tell me if I am going about the whole conundrum the wrong way.
    Thanks in advance.
    Last edited by Syzaghi; 09-22-2011 at 04:02 PM. Reason: Titl change

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Please help with this formula

    Hello and welcome to the forum - unfortunately you need to read the forum rules, because rule #1 says that threads must have titles descriptive of the problem, not generic requests for help. If you edit your post and sort out the title then I'll be happy to help you out with your formula.

    Thanks.

  3. #3
    Registered User
    Join Date
    09-22-2011
    Location
    Manchester
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Please help with this formula

    Quote Originally Posted by Andrew-R View Post
    Hello and welcome to the forum - unfortunately you need to read the forum rules, because rule #1 says that threads must have titles descriptive of the problem, not generic requests for help. If you edit your post and sort out the title then I'll be happy to help you out with your formula.

    Thanks.
    Sorry Andrew, Rookie mistake! I have changed the title and I will read the rest of the rules asap!

  4. #4
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: How to make a figure show a value in another cell dependent on a cell with text

    No problems - just notice that the rules also say not to quote entire posts

    As for your formula - I think all you need in C1 is =IF(A1="Stock",B1,"")

    If you want to be thorough then when working with strings it's a good idea to use the TRIM function to make sure that they have no leading or trailing spaces and the UPPER function to put them all into upper-case (or the LOWER function to put them all into lower-case, if you prefer). So that would give you =IF(UPPER(TRIM(A1))="STOCK",B1,"")

    And actually your original formula wasn't that far out, the FIND function finds one string within another and returns the character position that the searched for string starts at. The trouble is that if it can't find the string it returns an error, which is why you were having the problem.

    The fixed version of your original formula would be =IF(ISERROR(FIND("Stock",A1)),"",B1)

    Hope this helps.

  5. #5
    Registered User
    Join Date
    09-22-2011
    Location
    Manchester
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: How to make a figure show a value in another cell dependent on a cell with text

    Thank you Andrew for taking your time to help me. The formula worked perfectly and i'll make my Titles shorter

+ 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