+ Reply to Thread
Results 1 to 17 of 17

IF Functions

  1. #1
    Forum Contributor
    Join Date
    07-03-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    109

    IF Functions

    Hi,

    Can some please help me to add for than one IF function to one cell.

    I have started by putting a basic function in the attached. But it can only give me the correct answer if its true or false.

    I want to have multiple posibilities to say yes. I.E:-

    Is a test required for certain parts? Well the answer is YES for RRU, Hybrid, Micro and Pico, but no for RFU.

    Hopefully the attached sheet can explain better than I can

    Many Thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,437

    Re: IF Functions

    You could use OR to test for multiple conditions or, if you have a table set up, you could use VLOOKUP.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: IF Functions

    I think as you have a "key" already then a VLOOKUP would be the best bet, if I've understood what you're after correctly that it.

    Try entering the below formula in cell B2 on your example attachment and dragging down to B6.

    =VLOOKUP(A2,$A$14:$B$18,2,FALSE)


    Does that do what you want?
    If I've been of help, please hit the star

  4. #4
    Forum Contributor
    Join Date
    07-03-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    109

    Re: IF Functions

    Hi,

    Thank you for the reply, this does work well for the attached sheet, but unfortuantley I was just using that as an exapmle to show you what the results should be.

    I cannot have the key in the sheet Can you suggest another function please?

    Many Thanks

  5. #5
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: IF Functions

    Could you give us a slightly bigger sample workbook?

    We'd need to know all possible entries and their Yes/No answers.

  6. #6
    Forum Contributor
    Join Date
    07-03-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    109

    Re: IF Functions

    Hi,

    For the time being that will be all the entries I need.

    Once I see the formula, I can add to it as and when.

    Many Thanks

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: IF Functions

    =LOOKUP(A2,{"HYBRID","MICRO","PICO","RFU","RRU"},{"Yes","Yes","Yes","No","Yes"})
    this bit {"HYBRID","MICRO","PICO","RFU","RRU"} must be sorted ascending
    i never understand the i cant have the key in the sheet bit, it can always go in another sheet and hidden if need be
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  8. #8
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: IF Functions

    I agree with MDW above, the key stored somewhere and hidden would make life much easier. Both to write the formula AND to maintain it when new values are added.

    Using the LOOKUP supplied would be much easier than a string of embedded IFs (although it can be done that way).

  9. #9
    Forum Contributor
    Join Date
    07-03-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    109

    Re: IF Functions

    Hi,

    Thanks for the reply.

    But I cannot hand the tracker over to the customer with hidden cells and surplus sheets unfortuantley. So could you tell me the formula for the IF string Please

  10. #10
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: IF Functions

    you could use @mdw's LOOKUP formula to get the same results as the one below:

    Please Login or Register  to view this content.
    or this VLOOKUP:

    Please Login or Register  to view this content.
    Last edited by icestationzbra; 07-07-2012 at 10:36 PM. Reason: afterthought
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  11. #11
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: IF Functions

    And here is the pointlessly clunky nested IF:

    =IF(A2="RFU","No",IF(A2="RRU","Yes",IF(A2="HYBRID","Yes",IF(A2="MICRO","Yes",IF(A2="PICO","Yes","")))))

    Although with the specific data you have provided, you could also use:

    =IF(A2="RFU","No","Yes")

  12. #12
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: IF Functions

    But I cannot hand the tracker over to the customer with hidden cells and surplus sheets unfortuantley.
    of course you can how would they know? anyway you have been provided with 5 answers including mine which you completely ignored.

  13. #13
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: IF Functions

    i received rather strange pm.
    Why does it matter to you if I can or cannot hand it back to the customer?? No hidden formulas or extra sheets! End of.

    I appreciate your help with the formulas but not the constant questioning of the scope of works I am working too
    op seems to think criticism/suggestions are out of order.. well best you learn excel before committing to a client something you obviously cannot do.
    if i didn't know better i'd think it was my mrs having a bad day
    Last edited by martindwilson; 07-08-2012 at 03:32 PM.

  14. #14
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: IF Functions

    The minute the word "customer" was mentioned by OP I became suspicious...
    There's something just not quite right about it all.

    I get the feeling this thread should have been titled "Nested IF... How?" or something similar....

  15. #15
    Forum Contributor
    Join Date
    07-03-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    109

    Re: IF Functions

    Haha 2 different people have had a go in regards to an Excel question. I'm not sure why it bothers you so much, you both obviously know excel far better than me, so sorry if you felt my question was below your excel standards.

    Of course I don't know excel, otherwise I wouldn't be asking simple questions.

    I was under the impression that this forum was designed for people like me to come and ask questions and hopefully learn and maybe one day help someone else, maybe I was wrong.

    I have met some really helpful people on here and have learnt a lot. So thank you to them

  16. #16
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,437

    Re: IF Functions

    Most people answering questions on the forum want to help and give advice ... even if you don't feel you want or need it.

    No one wants to have a go at you ... but if you PM someone to tell them to back off, it sometimes sends the wrong message.

    You can see from the number of posts Martin has made that he has the knowledge and experience to make valid and practical suggestions. Maybe, you would benefit from listening ... the questions are to really understand your problem not to wind you up.

    Regards, TMS

  17. #17
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: IF Functions

    Nobody is "having a go" at anyone.

    There were several suggestions given, all of which were a better solution than the one you seemed to be alluding to. If nested IFs were what you needed to know for your customer's requirements then all you had to do was say.

    I struggle to think of any reason you couldn't use a hidden lookup table (or even a visible one).

    Anyway, I hope you have your solution now.

    S.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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