ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   LookUp Returning more than one rows (https://www.excelbanter.com/excel-programming/412102-lookup-returning-more-than-one-rows.html)

John

LookUp Returning more than one rows
 
Hi,

I have a sheet

A B

John 100
Alex 150
John 175
Steve 125

i want to get the sum of the entries for John, say here i have to get the
result as 100+175 = 275. Is there any function for me to do it?

I tried LookUp but its returning only the first value.

Thanks in advance
John,

Sam Wilson

LookUp Returning more than one rows
 
Hi,

You can use =SUMIF(A2:A5,"John",B2:B5)

"John" wrote:

Hi,

I have a sheet

A B

John 100
Alex 150
John 175
Steve 125

i want to get the sum of the entries for John, say here i have to get the
result as 100+175 = 275. Is there any function for me to do it?

I tried LookUp but its returning only the first value.

Thanks in advance
John,


petedacook

LookUp Returning more than one rows
 
You can also use an array formula:

{sum((A2:A5="john")*B2:B5)}

or if you have more than one criteria, you want john and steves totals:

{sum((A2:A5="john")+(A2:A5="steve")*B2:B5)}

remember to hold ctr+shift when you hit the enter key for array formulas.

"Sam Wilson" wrote:

Hi,

You can use =SUMIF(A2:A5,"John",B2:B5)

"John" wrote:

Hi,

I have a sheet

A B

John 100
Alex 150
John 175
Steve 125

i want to get the sum of the entries for John, say here i have to get the
result as 100+175 = 275. Is there any function for me to do it?

I tried LookUp but its returning only the first value.

Thanks in advance
John,



All times are GMT +1. The time now is 05:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com