Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Patti
 
Posts: n/a
Default Summing vlookups?

I'm stuck! Here's what I'm trying to do:

Vlookup($B$1,Named Range,$B$2,False)

This works, but there's more than one match for $B$1 in column A. I want to
sum the values in the column indicated in cell B2 if the data in column A
match the data in cell B1 --

Sumif(A:A,B1,[Column indicated in cell B2])

The problem is that the column with the values to be summed will change, so
a simple Sumif won't work. Thanks!
  #2   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
try something like
=SUMIF('sheet1'!A1:A100,B2,'sheet1'!B1:B100)

--
Regards
Frank Kabel
Frankfurt, Germany
"Patti" schrieb im Newsbeitrag
...
I'm stuck! Here's what I'm trying to do:

Vlookup($B$1,Named Range,$B$2,False)

This works, but there's more than one match for $B$1 in column A. I want
to
sum the values in the column indicated in cell B2 if the data in column A
match the data in cell B1 --

Sumif(A:A,B1,[Column indicated in cell B2])

The problem is that the column with the values to be summed will change,
so
a simple Sumif won't work. Thanks!



  #3   Report Post  
Patti
 
Posts: n/a
Default

Thanks for the quick reply Frank, but the number in cell B2 is the column for
the Vlookup and it changes. The problem that I had with the simple SumIf is
that the column to sum will change.

"Frank Kabel" wrote:

Hi
try something like
=SUMIF('sheet1'!A1:A100,B2,'sheet1'!B1:B100)

--
Regards
Frank Kabel
Frankfurt, Germany
"Patti" schrieb im Newsbeitrag
...
I'm stuck! Here's what I'm trying to do:

Vlookup($B$1,Named Range,$B$2,False)

This works, but there's more than one match for $B$1 in column A. I want
to
sum the values in the column indicated in cell B2 if the data in column A
match the data in cell B1 --

Sumif(A:A,B1,[Column indicated in cell B2])

The problem is that the column with the values to be summed will change,
so
a simple Sumif won't work. Thanks!




  #4   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

You can still do it, assume the named range is MyTable, then use

=SUMPRODUCT(--(INDEX(MyTable,,1)=B1),INDEX(MyTable,,B2))

the first 1 in index tells it to find the match in the first column just
like in a vlookup, then B2 tells what column to sum where A is the lookup
value


Regards,

Peo Sjoblom

"Patti" wrote:

Thanks for the quick reply Frank, but the number in cell B2 is the column for
the Vlookup and it changes. The problem that I had with the simple SumIf is
that the column to sum will change.

"Frank Kabel" wrote:

Hi
try something like
=SUMIF('sheet1'!A1:A100,B2,'sheet1'!B1:B100)

--
Regards
Frank Kabel
Frankfurt, Germany
"Patti" schrieb im Newsbeitrag
...
I'm stuck! Here's what I'm trying to do:

Vlookup($B$1,Named Range,$B$2,False)

This works, but there's more than one match for $B$1 in column A. I want
to
sum the values in the column indicated in cell B2 if the data in column A
match the data in cell B1 --

Sumif(A:A,B1,[Column indicated in cell B2])

The problem is that the column with the values to be summed will change,
so
a simple Sumif won't work. Thanks!




  #5   Report Post  
Patti
 
Posts: n/a
Default

Ah! That did the trick! Thanks so much!

"Peo Sjoblom" wrote:

You can still do it, assume the named range is MyTable, then use

=SUMPRODUCT(--(INDEX(MyTable,,1)=B1),INDEX(MyTable,,B2))

the first 1 in index tells it to find the match in the first column just
like in a vlookup, then B2 tells what column to sum where A is the lookup
value


Regards,

Peo Sjoblom

"Patti" wrote:

Thanks for the quick reply Frank, but the number in cell B2 is the column for
the Vlookup and it changes. The problem that I had with the simple SumIf is
that the column to sum will change.

"Frank Kabel" wrote:

Hi
try something like
=SUMIF('sheet1'!A1:A100,B2,'sheet1'!B1:B100)

--
Regards
Frank Kabel
Frankfurt, Germany
"Patti" schrieb im Newsbeitrag
...
I'm stuck! Here's what I'm trying to do:

Vlookup($B$1,Named Range,$B$2,False)

This works, but there's more than one match for $B$1 in column A. I want
to
sum the values in the column indicated in cell B2 if the data in column A
match the data in cell B1 --

Sumif(A:A,B1,[Column indicated in cell B2])

The problem is that the column with the values to be summed will change,
so
a simple Sumif won't work. Thanks!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Summing non consecutive cells csfrolich Excel Discussion (Misc queries) 12 January 9th 05 03:53 PM
Vlookups wmjenner Excel Worksheet Functions 2 November 23rd 04 10:39 PM
Summing cells in Excel marilena Excel Worksheet Functions 0 November 7th 04 12:22 AM
Summing cells in Excel marilena Excel Worksheet Functions 0 November 6th 04 11:55 PM
Summing Formula Steve W Excel Worksheet Functions 4 November 4th 04 12:06 PM


All times are GMT +1. The time now is 11:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"