+ Reply to Thread
Results 1 to 9 of 9

Complex IF Formula

  1. #1
    Registered User
    Join Date
    12-12-2010
    Location
    RI, USA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Complex IF Formula

    I have 11 different values so a nested IF function will not work. I have heard VLOOKUP suggested but I don't think it's what I need.

    I have 11 different categories for grouping items. Depending on which category it is, it has a certain formula. For example, if column D says 1, then what's in column G needs to be multiplied by 90%, if it says 2, then it needs to be multiplied by 80%, etc. This needs to happen down the rows. Vlookup just seems like it couldn't handle this.

    Any help or suggestions?

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Complex IF Formula

    Hi,

    From your description it's almost certain that a VLOOKUP is precisely what you need. Build yourself a two column table with 1,2,3, etc. in the first column, and 90%, 80%, 70% or whatever alongside in the adjacent column. Name the table say 'MyTable'

    Now use the formula

    Please Login or Register  to view this content.
    HTH
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    12-12-2010
    Location
    RI, USA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Complex IF Formula

    Ah I see. I was hoping to contain the whole process in one cell. Thanks.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Complex IF Formula

    You can put the VLOOKUP table on another tab or off to the side somewhere and hide those columns. If your rules don't change, the table won't change and you can forget about it. With 2003, you'd be hard pressed to find a solution within a single cell and it would be very ugly.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: Complex IF Formula

    Quote Originally Posted by davo1224 View Post
    Ah I see. I was hoping to contain the whole process in one cell. Thanks.
    You can contain it within one cell, by hard coding your table array.Write the formula as earlier advised with the vlookup, and for the first part make up a table with your 1-10 values in one column, and the values to return in the column next to it. once you've written the formula, highlight the cells representing the table and hit F9 you'll get a similar result to this

    VLOOKUP(F3,{1,90;2,80;3,70;4,60;5,50;6,40;7,30;8,20;9,10;10,0},2,0)

    F3 houses the Vlookup value, the numbers within the { } are your array of values and will return 90 for 1 80 for 2 etc etc
    Windows 7 using Office 2007 & 2010

    Remember your [ code ] [ /code ] tags, makes reading soooo much easier

  6. #6
    Registered User
    Join Date
    12-12-2010
    Location
    RI, USA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Complex IF Formula

    Yeah I'm just going to put it further away from the visible area.

    It ended up being exactly what I needed. Thanks.
    Last edited by davo1224; 12-15-2010 at 03:34 PM.

  7. #7
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Complex IF Formula

    Hi davo. you lost me. (not that hard). Take a look at the attached and see if its what you want. If you are saying that you specifically want the text written out in the next column, it would be (assuming name in A2, Catagory (2) in B2, Original $ in C2 and result in D2) in E2
    ="(if "&B2& ", then do "& TEXT(C2,"$0.00") & " x " & VLOOKUP(B2,Table,2,FALSE) & ")"
    Attached Files Attached Files

  8. #8
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: Complex IF Formula

    stealing the sample from the last poster, here's a version with an incell formula and no table displaying
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    12-12-2010
    Location
    RI, USA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Complex IF Formula

    Thanks so much everyone for the help. The incell formula is perfect and very easy to understand/tailor.

+ 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