Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 20
Default Vlookup to the left ?

I have a spreadsheet that looks like this:

1/1/09 <blank
1/2/09 DISC
1/3/09 <blank
1/4/09 <blank
1/5/09 <blank
1/6/09 DISC

I need to search the table and be able to report out all the dates where the
"DISC" value is in column B. The location where I want to report these will
be a separate workbook in the spreadsheet and I want them each reported as a
separate cell in a single row. Is there a way to use Vlookup to search the
2nd column and report the value from the first column....or is there some
other method of doing this ?

Thanks !

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Vlookup to the left ?

One way...

Assuming your data is on Sheet1 in the range A2:B7

In some other sheet enter this formula in A1:

=COUNTIF(Sheet1!B:B,"disc")

Enter this array formula** in A2 and copy down until you get blanks:

=IF(ROWS(A$2:A2)A$1,"",SMALL(IF(Sheet1!B$2:B$7="d isc",Sheet1!A$2:A$7),ROWS(A$2:A2)))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

Format A2:An as Date

--
Biff
Microsoft Excel MVP


"Eric_in_EVV" wrote in message
...
I have a spreadsheet that looks like this:

1/1/09 <blank
1/2/09 DISC
1/3/09 <blank
1/4/09 <blank
1/5/09 <blank
1/6/09 DISC

I need to search the table and be able to report out all the dates where
the
"DISC" value is in column B. The location where I want to report these
will
be a separate workbook in the spreadsheet and I want them each reported as
a
separate cell in a single row. Is there a way to use Vlookup to search
the
2nd column and report the value from the first column....or is there some
other method of doing this ?

Thanks !



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Vlookup to the left ?

You would normally use an INDEX/MATCH formula when your lookup values
are on the left of the sought item, but the problem with MATCH (and
VLOOKUP) is that it will only find the first occurrence or the sought-
value.

One way of doing this is to use Autofilter. Select DISC from the
filter pull-down on column B and then copy the visible cells in column
A to another sheet. Then you can transpose those dates across onto one
row.

If you wanted a formula solution (which will update automatically),
then you could enter this formula in C1 of the first sheet:

=IF(B1="","",COUNTIF(B$1:B1,"DISC"))

and copy this down. It will give you a running count against each
DISC. Then in Sheet2 you could put this formula in A1:

=IF(COLUMN(A1)MAX(Sheet1!C:C),"",INDEX(Sheet1!A:A ,MATCH(COLUMN
(A1),Sheet1!C:C,0)))

Then you can copy this across as far as you need to.

Hope this helps.

Pete

On Dec 1, 6:32*pm, Eric_in_EVV
wrote:
I have a spreadsheet that looks like this:

1/1/09 * * *<blank
1/2/09 * * *DISC
1/3/09 * * *<blank
1/4/09 * * *<blank
1/5/09 * * *<blank
1/6/09 * * *DISC

I need to search the table and be able to report out all the dates where the
"DISC" value is in column B. *The location where I want to report these will
be a separate workbook in the spreadsheet and I want them each reported as a
separate cell in a single row. *Is there a way to use Vlookup to search the
2nd column and report the value from the first column....or is there some
other method of doing this ?

Thanks !


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Vlookup to the left ?

Hi,

Try this array formula - See below on how to enter it - Array enter the
formul and then darg down to find second match etc.

=INDEX($A$1:$A$20,SMALL(IF($B$1:$B$20="Disc",ROW($ A$1:$A$20)-ROW($E$1)+1),ROWS(B$1:B1)))

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.

Mike


"Eric_in_EVV" wrote:

I have a spreadsheet that looks like this:

1/1/09 <blank
1/2/09 DISC
1/3/09 <blank
1/4/09 <blank
1/5/09 <blank
1/6/09 DISC

I need to search the table and be able to report out all the dates where the
"DISC" value is in column B. The location where I want to report these will
be a separate workbook in the spreadsheet and I want them each reported as a
separate cell in a single row. Is there a way to use Vlookup to search the
2nd column and report the value from the first column....or is there some
other method of doing this ?

Thanks !



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default Vlookup to the left ?

Just recorded a simple macro; may be the easiest way:
Sub Macro1()

Selection.AutoFilter
ActiveSheet.Range("$A$1:$B$100").AutoFilter Field:=2, Criteria1:="<"
Columns("A:A").Select
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Range("C1").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True
End Sub

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Eric_in_EVV" wrote:

I have a spreadsheet that looks like this:

1/1/09 <blank
1/2/09 DISC
1/3/09 <blank
1/4/09 <blank
1/5/09 <blank
1/6/09 DISC

I need to search the table and be able to report out all the dates where the
"DISC" value is in column B. The location where I want to report these will
be a separate workbook in the spreadsheet and I want them each reported as a
separate cell in a single row. Is there a way to use Vlookup to search the
2nd column and report the value from the first column....or is there some
other method of doing this ?

Thanks !

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default Vlookup to the left ?

After RE-reading, I suggest this macro. Correct word wrap if necessary

Sub finddisc()
Set ss = sheets("sheet11")
Set ds = sheets("sheet6")
MC = 5 'column E
With ss.Columns(MC)
Set c = .find("DISC", LookIn:=xlValues, LookAt:=xlWhole, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)

If Not c Is Nothing Then
firstAddress = c.Address
Do
'MsgBox c.Row
ds.Cells(Rows.Count, "i").End(xlUp).Offset(1) = ss.Cells(c.Row, MC - 1)
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Eric_in_EVV" wrote in message
...
I have a spreadsheet that looks like this:

1/1/09 <blank
1/2/09 DISC
1/3/09 <blank
1/4/09 <blank
1/5/09 <blank
1/6/09 DISC

I need to search the table and be able to report out all the dates where
the
"DISC" value is in column B. The location where I want to report these
will
be a separate workbook in the spreadsheet and I want them each reported as
a
separate cell in a single row. Is there a way to use Vlookup to search
the
2nd column and report the value from the first column....or is there some
other method of doing this ?

Thanks !


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 20
Default Vlookup to the left ?

Thank you all for the responses. They all seem to work as expected. The one
that seems best for my specific situation is the one posted by Pete. I just
love this forum...it's a great place to get advice on solutions !

Thank you all so much !

"Don Guillett" wrote:

After RE-reading, I suggest this macro. Correct word wrap if necessary

Sub finddisc()
Set ss = sheets("sheet11")
Set ds = sheets("sheet6")
MC = 5 'column E
With ss.Columns(MC)
Set c = .find("DISC", LookIn:=xlValues, LookAt:=xlWhole, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)

If Not c Is Nothing Then
firstAddress = c.Address
Do
'MsgBox c.Row
ds.Cells(Rows.Count, "i").End(xlUp).Offset(1) = ss.Cells(c.Row, MC - 1)
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Eric_in_EVV" wrote in message
...
I have a spreadsheet that looks like this:

1/1/09 <blank
1/2/09 DISC
1/3/09 <blank
1/4/09 <blank
1/5/09 <blank
1/6/09 DISC

I need to search the table and be able to report out all the dates where
the
"DISC" value is in column B. The location where I want to report these
will
be a separate workbook in the spreadsheet and I want them each reported as
a
separate cell in a single row. Is there a way to use Vlookup to search
the
2nd column and report the value from the first column....or is there some
other method of doing this ?

Thanks !


.

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Vlookup to the left ?

Well, thanks for feeding back, Eric - glad to be of help.

Pete

On Dec 2, 4:25*am, Eric_in_EVV
wrote:
Thank you all for the responses. *They all seem to work as expected. *The one
that seems best for my specific situation is the one posted by Pete. *I just
love this forum...it's a great place to get advice on solutions !

Thank you all so much !



"Don Guillett" wrote:
After RE-reading, I suggest this macro. Correct word wrap if necessary


Sub finddisc()
Set ss = sheets("sheet11")
Set ds = sheets("sheet6")
MC = 5 'column E
With ss.Columns(MC)
* * Set c = .find("DISC", LookIn:=xlValues, LookAt:=xlWhole, _
* * SearchOrder:=xlByRows, SearchDirection:=xlNext, _
* * MatchCase:=False, SearchFormat:=False)


* * If Not c Is Nothing Then
* * * * firstAddress = c.Address
* * * * Do
* * * * * * 'MsgBox c.Row
* *ds.Cells(Rows.Count, "i").End(xlUp).Offset(1) = ss.Cells(c.Row, MC - 1)
* * * * * * Set c = .FindNext(c)
* * * * Loop While Not c Is Nothing And c.Address < firstAddress
* * End If
End With
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Eric_in_EVV" wrote in message
...
I have a spreadsheet that looks like this:


1/1/09 * * *<blank
1/2/09 * * *DISC
1/3/09 * * *<blank
1/4/09 * * *<blank
1/5/09 * * *<blank
1/6/09 * * *DISC


I need to search the table and be able to report out all the dates where
the
"DISC" value is in column B. *The location where I want to report these
will
be a separate workbook in the spreadsheet and I want them each reported as
a
separate cell in a single row. *Is there a way to use Vlookup to search
the
2nd column and report the value from the first column....or is there some
other method of doing this ?


Thanks !


.- Hide quoted text -


- Show quoted text -


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 to the left? Mac[_3_] Excel Discussion (Misc queries) 4 July 29th 08 12:16 PM
'RIGHT', 'LEFT' in a VLOOKUP RJB Excel Discussion (Misc queries) 6 March 14th 08 12:05 PM
vlookup left Mottyb Excel Worksheet Functions 2 November 22nd 07 07:58 PM
VLOOKUP LEFT VS RIGHT Jerry[_2_] Excel Worksheet Functions 2 September 7th 07 03:40 PM
VLOOKUP *Left* Value jim Excel Discussion (Misc queries) 4 June 5th 06 05:15 PM


All times are GMT +1. The time now is 02:53 AM.

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"