Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default vlookup with match

Here is the code:
=VLOOKUP(S7,A4:A1000,MATCH(T3,B4:B1000,0)+1,FALSE)
I am getting a #ref error.

s7 is the date I am looing for in a column and t3 is text that I am looking
for. What I want is to first look by the date and if the date matches it
looks for the text and if both match it will add the number of times that it
sees those 2 together and return that value. Any ideas on how to get this to
work?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default vlookup with match

Maybe

=SUMPRODUCT((A4:A1000=S7)*(B4:B1000=T3))

Mike

"tim2216" wrote:

Here is the code:
=VLOOKUP(S7,A4:A1000,MATCH(T3,B4:B1000,0)+1,FALSE)
I am getting a #ref error.

s7 is the date I am looing for in a column and t3 is text that I am looking
for. What I want is to first look by the date and if the date matches it
looks for the text and if both match it will add the number of times that it
sees those 2 together and return that value. Any ideas on how to get this to
work?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default vlookup with match

So far so good is there an easy way to copy this or is do I need to enter
this into every cell? I have close to 500 cells.

"Mike H" wrote:

Maybe

=SUMPRODUCT((A4:A1000=S7)*(B4:B1000=T3))

Mike

"tim2216" wrote:

Here is the code:
=VLOOKUP(S7,A4:A1000,MATCH(T3,B4:B1000,0)+1,FALSE)
I am getting a #ref error.

s7 is the date I am looing for in a column and t3 is text that I am looking
for. What I want is to first look by the date and if the date matches it
looks for the text and if both match it will add the number of times that it
sees those 2 together and return that value. Any ideas on how to get this to
work?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default vlookup with match

If I understand correctly, you want to copy this logic to other cells
programmatically:

activecell.copy
range(activecell,activecell.offset(500,0)).paste
application.cutcopymode = false

Remarks:

1. The offset property uses the r,c convention - therefore, the code above
tells Excel to select a range that is 501 rows by 1 column, relative to the
activecell's address

1. You may want to freeze relevant cells in your SUMPRODUCT formula:
=SUMPRODUCT(($A$4:$A$1000=S7)*($B$4:$B$1000=T3))

HTH



"tim2216" wrote:

So far so good is there an easy way to copy this or is do I need to enter
this into every cell? I have close to 500 cells.

"Mike H" wrote:

Maybe

=SUMPRODUCT((A4:A1000=S7)*(B4:B1000=T3))

Mike

"tim2216" wrote:

Here is the code:
=VLOOKUP(S7,A4:A1000,MATCH(T3,B4:B1000,0)+1,FALSE)
I am getting a #ref error.

s7 is the date I am looing for in a column and t3 is text that I am looking
for. What I want is to first look by the date and if the date matches it
looks for the text and if both match it will add the number of times that it
sees those 2 together and return that value. Any ideas on how to get this to
work?

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 retunrning a match, when not a match... Dave Peterson Excel Worksheet Functions 1 October 2nd 08 11:22 PM
vlookup retunrning a match, when not a match... mark Excel Worksheet Functions 4 October 2nd 08 10:39 PM
vlookup retunrning a match, when not a match... Niek Otten Excel Worksheet Functions 0 October 2nd 08 09:00 PM
second or third match in vlookup() or Match() Dan Excel Worksheet Functions 5 June 3rd 08 07:17 PM
index Match, or Vlookup Match.. news.transedge.com Excel Worksheet Functions 1 August 3rd 07 02:00 AM


All times are GMT +1. The time now is 03:48 AM.

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

About Us

"It's about Microsoft Excel"