+ Reply to Thread
Results 1 to 2 of 2

Nested If problem!

Hybrid View

  1. #1
    Registered User
    Join Date
    05-26-2013
    Location
    Myanmar
    MS-Off Ver
    Excel 2010
    Posts
    2

    Nested If problem!

    Hi guys!
    Here is my nested if
    =IF(C45=$C$2, $B$2,IF(C45=$C$3, $B$3,IF(C45=$C$4, $B$4,IF(C45=$C$5, $B$5,IF(C45=$C$6, $B$6,IF(C45=$C$7, $B$7,IF(C45=$C$8, $B$8,IF(C45=$C$9, $B$9,IF(C45=$C$10, $B$10,IF(C45=$C$11,$B$11,IF(C45=$C$12, $B$12,IF(C45=$C$13, $B$13,IF(C45=$C$14, $B$14,IF(C45=$C$15, $B$15,IF(C45=$C$16, $B$16,IF(C45=$C$17, $B$17,IF(C45=$C$18, $B$18,IF(C45=$C$19, $B$19,IF(C45=$C$20, $B$20,IF(C45=$C$21, $B$21,IF(C45=$C$22, $B$22,IF(C45=$C$23, $B$23,IF(C45=$C$24, $B$24,IF(C45=$C$25, $B$25,IF(C45=$C$26, $B$26,IF(C45=$C$27, $B$27,IF(C45=$C$28, $B$28,IF(C45=$C$29, $B$29,IF(C45=$C$30, $B$30,IF(C45=$C$31, $B$31,IF(C45=$C$32, $B$32,IF(C45=$C$33, $B$33,IF(C45=$C$34, $B$34,IF(C45=$C$35, $B$35,IF(C45=$C$36, $B$36,IF(C45=$C$37, $B$37,IF(C45=$C$38, $B$38,IF(C45=$C$39, $B$39,IF(C45=$C$40, $B$40,IF(C45=$C$41, $B$41,IF(C45=$C$42, $B$42,IF(C45=$C$43, $B$43,IF(C45=$C$44, $B$44, "Something Goes Wrong")))))))))))))))))))))))))))))))))))))))))))
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    =IF(C45="Seed Sesame", "BBT-100026",IF(C45="Seed Nut", "BBT-100028",IF(C45="Corn Flakes", "BBT-100051",IF(C45="Coco Crunch", "BBT-100068",IF(C45="Blender Machine", "GST-1006602",IF(C45="Shaving Machine", "GST-1006615",IF(C45="Milk Powder", "DGN-205008",IF(C45="Chocolate Powder", "DGN-205591",IF(C45="Sugar", "DGN-201143",IF(C45="Avocado Essence","DGN-204425",IF(C45="Chocolate Essence", "DGN-204427",IF(C45="Coffee Essence", "DGN-204436",IF(C45="Almond Flakes", "BBT-100609",IF(C45="Mix Fruit (tin)", "DGN-206751",IF(C45="8 Fold Paper Towel", "LHL-507062",IF(C45="Paper Cup", "LHL-500405",IF(C45="Plastic Spoon", "LHL-500202",IF(C45="Straw", "LHL-500189",IF(C45="Plastic bowl", "LHL-500198",IF(C45="Coconut Oil", "FTG-700259",IF(C45="Sun Flower Oil", "FTG-700246",IF(C45="Sesame Oil", "FTG-700239",IF(C45="Gas Stove", "DGN-300442",IF(C45="Gas Refill", "DGN-300449",IF(C45="Fibre Tray", "FTG-100568",IF(C45="Steel Trolley", "FTG-600326",IF(C45="Wooden Chair", "LHL-501268",IF(C45="Wooden Table", "LHL-501272",IF(C45="Steel Chair", "FTG-400103",IF(C45="Steel Table", "FTG-400124",IF(C45="Glass", "BBT-204878",IF(C45="Steel Mug", "BBT-204901",IF(C45="Frozen Prawn", "FTG-882461",IF(C45="Frozen Chicken", "FTG-882448",IF(C45="Frozen Fish", "FTG-882495",IF(C45="Fruit Apple", "LHL-200159",IF(C45="Fruit Avocado", "LHL-200168",IF(C45="Fruit Orange", "LHL-200142",IF(C45="Fruit Grape", "LHL-200151",IF(C45="Fruit Water Melon", "LHL-200184",IF(C45="Fruit Lady Melon", "LHL-200187",IF(C45="Fruit Rock Melon", "LHL-200181",IF(C45="Fruit Sun Melon", "LHL-200189", "Something Goes Wrong")))))))))))))))))))))))))))))))))))))))))))
    And I only get the output as TRUE. Not an expected result.
    Please help!

  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,697

    Re: Nested If problem!

    Why not just use INDEX/MATCH?

    =IFERROR(INDEX($B:$B,MATCH($C$45,$C:$C,0)),"Not Found")


    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


+ 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