Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Vlookup to Return Cell Name Not Value?

I'm wondering if I can do the following with this table...on
tab1(snippet of raw data)
colA colB
2 55
3 57
6 51
9 40
10 42

I was trying to get vlookup to to work on tab2...
colA colB
3 * this is where I want to use vlookup
9

What I need to do is sum up all values in tab1.colB from 3 through 9.
So I was thinking if I could get vlookup to return the cell number
then I can do a sum from the return value. I hope I'm making this
clear. Any help is appreciated.

-Bruce

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Vlookup to Return Cell Name Not Value?

If I've understood correctly this may do what you want:-

=SUMIF(Sheet1!A1:A5,"=3",Sheet1!B1:B5)-(SUMIF(Sheet1!A1:A5,"9",Sheet1!B1:B5))

Mike

" wrote:

I'm wondering if I can do the following with this table...on
tab1(snippet of raw data)
colA colB
2 55
3 57
6 51
9 40
10 42

I was trying to get vlookup to to work on tab2...
colA colB
3 * this is where I want to use vlookup
9

What I need to do is sum up all values in tab1.colB from 3 through 9.
So I was thinking if I could get vlookup to return the cell number
then I can do a sum from the return value. I hope I'm making this
clear. Any help is appreciated.

-Bruce


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Vlookup to Return Cell Name Not Value?

set sumrange = sheets("Tab1").Range("B3:B9")
mysum = worksheetfunction.sum(sumrange)

" wrote:

I'm wondering if I can do the following with this table...on
tab1(snippet of raw data)
colA colB
2 55
3 57
6 51
9 40
10 42

I was trying to get vlookup to to work on tab2...
colA colB
3 * this is where I want to use vlookup
9

What I need to do is sum up all values in tab1.colB from 3 through 9.
So I was thinking if I could get vlookup to return the cell number
then I can do a sum from the return value. I hope I'm making this
clear. Any help is appreciated.

-Bruce


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default Vlookup to Return Cell Name Not Value?

Hi Bruce,

Use MATCH() instead of VLOOKUP. MATCH() returns the relative position of the item found

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

wrote in message ...
| I'm wondering if I can do the following with this table...on
| tab1(snippet of raw data)
| colA colB
| 2 55
| 3 57
| 6 51
| 9 40
| 10 42
|
| I was trying to get vlookup to to work on tab2...
| colA colB
| 3 * this is where I want to use vlookup
| 9
|
| What I need to do is sum up all values in tab1.colB from 3 through 9.
| So I was thinking if I could get vlookup to return the cell number
| then I can do a sum from the return value. I hope I'm making this
| clear. Any help is appreciated.
|
| -Bruce
|


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Vlookup to Return Cell Name Not Value?

I did use Match (thanks Niek). Here's what I got:

=ADDRESS(MATCH($C28,Charges!$C$1:$C$401),
8,,,"Charges")&":"&ADDRESS(MATCH($C40,Charges!$C$1 :$C
$401)-1,8,,,"Charges")

Which returns..exactly correct!
Charges!$H$40:Charges!$H$52

But now the problem is that I need to sum up this range and if I just
add SUM() it won't work because it's being treated as a string...help?

-Bruce




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Vlookup to Return Cell Name Not Value?

I got it working with this...thanks for the replies!

=SUM(INDIRECT("Charges!"&ADDRESS(MATCH($C136,Charg es!$C$1:$C$401),
8)&":"&ADDRESS(MATCH($C148,Charges!$C$1:$C$401)-1,8)))/2000

-Bruce

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
Vlookup and Trace Return Cell TM Excel Discussion (Misc queries) 2 March 9th 10 11:30 PM
VLOOKUP to return Cell Address Steve Haack Excel Worksheet Functions 3 January 20th 10 07:07 PM
To return a blank cell rather than 0% in a vlookup. Romileyrunner1 Excel Worksheet Functions 9 August 27th 09 02:36 PM
USING VLOOKUP TO RETURN A CELL ADDRESS psych142 Excel Worksheet Functions 5 December 8th 08 01:04 AM
Vlookup return 0 when cell is blank Paul Excel Worksheet Functions 2 January 11th 06 05:01 PM


All times are GMT +1. The time now is 11:49 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"