+ Reply to Thread
Results 1 to 11 of 11

Formula with LOOKUP but with 2 columns

  1. #1
    Registered User
    Join Date
    01-09-2015
    Location
    Europe
    MS-Off Ver
    8
    Posts
    2

    Formula with LOOKUP but with 2 columns

    Hello, can you help me write a formula using LOOKUP or IF or something else, I'm at a loss, or maybe it can't be done.
    I want to calculate the value from a column (A) but only add values from rows if set conditions are met in column B and column C

    so the formula wirtten in a cell in List 1 will use values from columns in List 2, which has 3 columns:
    ////AAA BBB CCC
    1 7 4.1 f
    2 15 4.2 g
    3 5 4.2 i
    4 89 4.3 g
    5 6 4.2 g

    So basically, if I choose to combine for instance the value "4.1" with "g" then I want to sum up the values from column A, but only those which have the value "4.1"in column B and the value "g" in column C.

    I thought LOOKUP would be the best but it doesn't seem to want to combine 2 columns.
    I started with =LOOKUP("4.1";List2!I:I;SUM(List2!G:G)) but that's only the 1 value in 1 column + it's not even working, anyone has an idea?
    Marianka

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Formula with LOOKUP but with 2 columns

    Hi and welcome to the forum!

    Have a look at the SUMIFS function, assuming you're on Excel 2007 or later. If not, you'll need SUMPRODUCT.

    Regards
    Click * below if this answer helped

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

  3. #3
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Formula with LOOKUP but with 2 columns

    Hello
    Welcome to the forum
    Use this formula

    =SUM(IF(B1:B10=4.1,IF(G1:G10="g",A1:A10,0)))

    change the range as required
    This is an array formula to use this copy it from here
    then press F2 on the cell where you want the result.....cursor will appear....now paste the formula and press CTRL+SHIFT+ENTER instead of just enter as we usually do...

    Hope it helps

    If you are satisfied just click on ADD REPUTATION below.....

    Regrds
    Sourabh Gupta

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Formula with LOOKUP but with 2 columns

    Do you mean add up values in A column, if B column is 4.1 OR C column is "g"?
    If yes, try something like this:
    =SUMPRODUCT((B:B=4.1)+(C:C="g"))
    Quang PT

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Formula with LOOKUP but with 2 columns

    @sourabhg98

    Why use a CSE formula when we have SUMIFS and SUMPRODUCT?

    @bebo021999

    We've just been talking about this!

    http://www.excelforum.com/excel-form...y-formula.html

    Really not a good idea to use entire column references in SUMPRODUCT!

    Regards

  6. #6
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Formula with LOOKUP but with 2 columns

    ohhh
    I forgot that lolll
    =SUMIFS(A:A,B:B,4.1,G:G,"g")
    we can use this too

  7. #7
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Formula with LOOKUP but with 2 columns

    Quote Originally Posted by XOR LX View Post
    @sourabhg98

    Why use a CSE formula when we have SUMIFS and SUMPRODUCT?

    @bebo021999

    We've just been talking about this!

    http://www.excelforum.com/excel-form...y-formula.html

    Really not a good idea to use entire column references in SUMPRODUCT!

    Regards
    Actually I have learnt to use array formulas in the past few days and I was quite excited to use them......LOL

  8. #8
    Registered User
    Join Date
    01-08-2015
    Location
    Vietnam
    MS-Off Ver
    2007
    Posts
    2

    Re: Formula with LOOKUP but with 2 columns

    Hi, Marinka!
    I'm not sure whether i understand completely your question. Whatever, try that: =sumifs(columnA,columnB,4.1,columnC,"g")
    There're some more functions you can use.
    Hope it helps.
    Last edited by micheleK; 01-16-2015 at 12:59 AM.

  9. #9
    Registered User
    Join Date
    01-09-2015
    Location
    Europe
    MS-Off Ver
    8
    Posts
    2

    Re: Formula with LOOKUP but with 2 columns

    Thank you all so much, SUMIFS works like a charm, you are all so fast, thank you!

  10. #10
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Formula with LOOKUP but with 2 columns

    Quote Originally Posted by sourabhg98 View Post
    Actually I have learnt to use array formulas in the past few days and I was quite excited to use them......LOL
    I did precisely the same! I think we all go through an "array formula phase" at some point in our lives, in which we use them just about everywhere!

    Regards

  11. #11
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Formula with LOOKUP but with 2 columns

    Quote Originally Posted by XOR LX View Post
    I did precisely the same! I think we all go through an "array formula phase" at some point in our lives, in which we use them just about everywhere!

    Regards
    Yehh....it happens!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Lookup formula to match against two columns
    By WFP111 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 07-08-2014, 11:33 PM
  2. [SOLVED] Lookup mutiple columns - formula
    By Caradonguy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-07-2013, 05:02 AM
  3. array formula lookup spanning two columns
    By bennunn in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-21-2013, 11:23 AM
  4. V lookup but with 2 columns, so what formula?
    By Megan619 in forum Excel General
    Replies: 2
    Last Post: 06-19-2012, 03:52 PM

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