+ Reply to Thread
Results 1 to 15 of 15

Excel 2007 : Function to enter data in 2 columns and get data in 3rd Column automatically

  1. #1
    Registered User
    Join Date
    05-20-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    5

    Function to enter data in 2 columns and get data in 3rd Column automatically

    Hello, I am new to Excel. In the Reference Function chapter (Vlookup,Hlookup, etc), there's a question which I have attached here.

    Pls help me .
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    03-16-2012
    Location
    Aarhus, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    992

    Re: Function to enter data in 2 columns and get data in 3rd Column automatically

    Try this in C18:

    =SUMPRODUCT(($A$2:$A$12=A18)*($B$2:$B$12=B18),$C$2:$C$12) and copy down.
    Sincerely
    S?ren Larsen

    "Give a man a fish, and you'll feed him for a day. Give a man a fishing rod, and he'll steal your yacht!"

  3. #3
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Function to enter data in 2 columns and get data in 3rd Column automatically

    Duplicate post: http://www.excelforum.com/hello-intr...matically.html

    The above is in Introductory section - so just to let everyone know that responses MAY be made there.
    Last edited by Cutter; 05-20-2012 at 01:13 PM.

  4. #4
    Registered User
    Join Date
    05-20-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Function to enter data in 2 columns and get data in 3rd Column automatically

    Hello Soren, is there any way that the above problem cud be solved using Vlookup ?

  5. #5
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Function to enter data in 2 columns and get data in 3rd Column automatically

    It can be solved with SUMIFS() (because there are no duplicate combinations)

    =SUMIFS($C$2:$C$12,$A$2:$A$12,A18,$B$2:$B$12,B18)

  6. #6
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Function to enter data in 2 columns and get data in 3rd Column automatically

    Hi Somali,

    If you need vlookup solution, you can use below one for year:-

    =VLOOKUP($A$18,$A$1:$C$14,2,0)

    and below one for value:-

    =VLOOKUP($A$18,$A$1:$C$14,3,0)

    Note:- If you have multiple results to be obtained... vlookup will pick up the upper one.. thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  7. #7
    Valued Forum Contributor
    Join Date
    03-16-2012
    Location
    Aarhus, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    992

    Re: Function to enter data in 2 columns and get data in 3rd Column automatically

    Quote Originally Posted by somali.cc View Post
    Hello Soren, is there any way that the above problem cud be solved using Vlookup ?
    Firstly; go with Cutter's solution. It's better than my =SUMPRODUCT() alternative.

    Secondly, with regards to using =VLOOKUP(), I guess it would be possible. But it would be a bit more complicated than is nescessary, since you have two criteria that need to be fulfilled. I don't see any reason why you wouldn't use =SUMIFS(), but perhaps I'm missing something?

  8. #8
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Function to enter data in 2 columns and get data in 3rd Column automatically

    I think it might be a requirement of the assignment.

  9. #9
    Registered User
    Join Date
    05-20-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Function to enter data in 2 columns and get data in 3rd Column automatically

    Yes Cutter, u r right. We have not yet been taught the functions like ' SUMIFS' and 'SUMPRODUCT' .

    The assignment has been given under Lookup and Reference Functions Topic.

  10. #10
    Valued Forum Contributor
    Join Date
    03-16-2012
    Location
    Aarhus, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    992

    Re: Function to enter data in 2 columns and get data in 3rd Column automatically

    The way I would do it then, would be to create a "helper" column in the original data, and then in the lookup function use concatenate, but it could probably be done more elegantly.

  11. #11
    Registered User
    Join Date
    05-20-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Function to enter data in 2 columns and get data in 3rd Column automatically

    Dilip thanx for ur reply, but Vlookup format u suggested isnot serving the purpose.

  12. #12
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Function to enter data in 2 columns and get data in 3rd Column automatically

    Okay Somali... share your purpose i.e., type the results manually which you want to see and I'll try to get them using formulas.. thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  13. #13
    Registered User
    Join Date
    05-20-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Function to enter data in 2 columns and get data in 3rd Column automatically

    Hi Dilip, The following is my requirement: A function has to be inserted in $C$18 so that ...

    If I type ' Office ' in $A$18 and I type ' 2003 ' in $B$18, then $C$18 will automatically dispaly ' 6700 '.

    Again, If I type ' Office ' in $A$18 and I type ' 2007 ' in $B$18, then $C$18 will automatically display ' 9000 ' .

    The SUMIFS() function suggested by Cutter is working absolutely fine, but we have so far covered the following functions-

    IF() , AND(), OR(), NOT(), COUNT(), VLOOKUP(), HLOOKUP(), SUM(), SUMIF(), COUNTBLANK().
    Last edited by somali.cc; 05-21-2012 at 04:55 AM.

  14. #14
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Function to enter data in 2 columns and get data in 3rd Column automatically

    Hi Somali,

    use the below function :-

    {=INDEX($A$2:$C$12,MATCH(A18&B18,$A$2:$A$12&$B$2:$B$12,0),3)}

    See the attachment :-
    Datasheet.xlsx

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  15. #15
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Function to enter data in 2 columns and get data in 3rd Column automatically

    @dilipandey

    I think you're missing the point here. This is homework and OP can't use a formula that hasn't been taught yet. I wouldn't have posted a solution had I realized at the time that it was homework.

+ 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