Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Do I need to use 'IF' function?

I have a street database that contains 9 columns. Not all of them will be
used on each record. Here's my problem. I have a column named ST_NAME and a
column named OID that have all my information in them. It's set up like this:
ST_NAME OID STREET_2 STREET_3 STREET_4
Leigh cv 22
Mays ln 22
Stoneridge 22
Russell 54
Makala 54

Where the OID are all the same, each of those streets need to be placed in a
seperate street column, instead of all being under ST_NAME. Leigh cv, Mays
Ln, and Stoneridge should occupy ST_NAME, STREET_2, and STREET_3 all in the
same row. I'm not sure how to set up functions for this.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default Do I need to use 'IF' function?

On Oct 16, 7:16 am, Jennifer Andrews <Jennifer
wrote:
Where the OID are all the same, each of those streets need to
be placed in a seperate street column, instead of all being under
ST_NAME. Leigh cv, Mays Ln, and Stoneridge should occupy
ST_NAME, STREET_2, and STREET_3 all in the same row.
I'm not sure how to set up functions for this.


I am not sure I understand the assumptions you can make and the result
that you want, but I wonder if the following helps.

Assume ST_NAME, OID, STREET_2, STREET_3 and STREET_4 are columns A, B,
C, D and E, and assume "Leigh cv" is in row 2. Insert the following
formulas and copy them down their columns:

C2: if(and(B1<B2,B2=B3), A3, "")
D2: if(and(B1<B2,B2=B4), A4, "")
E2: if(and(B1<B2,B2=B5), A5, "")

Thus, in the first row with a new OID, STREET_2, STREET_3 and STREET_4
will contain up to the next 3 adjacent street names with the same
OID. Those columns will remain blank in the non-first rows with the
same OID.


----- complete original posting -----

On Oct 16, 7:16 am, Jennifer Andrews <Jennifer
wrote:
I have a street database that contains 9 columns. Not all of them will be
used on each record. Here's my problem. I have a column named ST_NAME and a
column named OID that have all my information in them. It's set up like this:
ST_NAME OID STREET_2 STREET_3 STREET_4
Leigh cv 22
Mays ln 22
Stoneridge 22
Russell 54
Makala 54

Where the OID are all the same, each of those streets need to be placed in a
seperate street column, instead of all being under ST_NAME. Leigh cv, Mays
Ln, and Stoneridge should occupy ST_NAME, STREET_2, and STREET_3 all in the
same row. I'm not sure how to set up functions for this.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Do I need to use 'IF' function?

Don't know about functions, but it is simple with a macro

Public Sub ProcessData()
Dim i As Long
Dim iLastRow As Long

With ActiveSheet

iLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = iLastRow To 2 Step -1
If .Cells(i, "B").Value = .Cells(i - 1, "B").Value Then
.Cells(i, "C").Resize(, 2).Copy .Cells(i, "D")
.Cells(i, "A").Copy .Cells(i, "C")
.Cells(i, "C").Resize(, 3).Copy .Cells(i - 1, "C")
.Rows(i).Delete
End If
Next i

End With

End Sub


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Jennifer Andrews" <Jennifer wrote in
message ...
I have a street database that contains 9 columns. Not all of them will be
used on each record. Here's my problem. I have a column named ST_NAME
and a
column named OID that have all my information in them. It's set up like
this:
ST_NAME OID STREET_2 STREET_3 STREET_4
Leigh cv 22
Mays ln 22
Stoneridge 22
Russell 54
Makala 54

Where the OID are all the same, each of those streets need to be placed in
a
seperate street column, instead of all being under ST_NAME. Leigh cv,
Mays
Ln, and Stoneridge should occupy ST_NAME, STREET_2, and STREET_3 all in
the
same row. I'm not sure how to set up functions for this.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Do I need to use 'IF' function?

Vacation?<bg
--

Regards,

RD
-----------------------------------------------------------------------------------------------
Please keep all correspondence within the Group, so all may benefit !
-----------------------------------------------------------------------------------------------

"Bob Phillips" wrote in message
...
Don't know about functions, but it is simple with a macro

Public Sub ProcessData()
Dim i As Long
Dim iLastRow As Long

With ActiveSheet

iLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = iLastRow To 2 Step -1
If .Cells(i, "B").Value = .Cells(i - 1, "B").Value Then
.Cells(i, "C").Resize(, 2).Copy .Cells(i, "D")
.Cells(i, "A").Copy .Cells(i, "C")
.Cells(i, "C").Resize(, 3).Copy .Cells(i - 1, "C")
.Rows(i).Delete
End If
Next i

End With

End Sub


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Jennifer Andrews" <Jennifer wrote in
message ...
I have a street database that contains 9 columns. Not all of them will be
used on each record. Here's my problem. I have a column named ST_NAME
and a
column named OID that have all my information in them. It's set up like
this:
ST_NAME OID STREET_2 STREET_3 STREET_4
Leigh cv 22
Mays ln 22
Stoneridge 22
Russell 54
Makala 54

Where the OID are all the same, each of those streets need to be placed in
a
seperate street column, instead of all being under ST_NAME. Leigh cv,
Mays
Ln, and Stoneridge should occupy ST_NAME, STREET_2, and STREET_3 all in
the
same row. I'm not sure how to set up functions for this.




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 751
Default Do I need to use 'IF' function?

And one solution with formulas, for the fun...
Assume ST_NAME, OID in row 1, A1:B1, streets start on A2, OID's on B2.

Place all the OID's successively. E.g. 22 in F2, 54 in F3. Start in G2
with this *array* formula:

=IF(COUNTIF($B$2:$B$6,$F2)=COLUMNS($G$1:G1),INDEX ($A$2:$A
$6,SMALL(IF($B$2:$B$6=$F2,ROW($A$2:$A$6)-ROW($A$2)+1),COLUMNS($G
$1:G1))),"")

As an array formula it must be committed with Shift+Ctrl+Enter. Now,
copy down and across to suit.

HTH
Kostis Vezerides

On Oct 16, 5:16 pm, Jennifer Andrews <Jennifer
wrote:
I have a street database that contains 9 columns. Not all of them will be
used on each record. Here's my problem. I have a column named ST_NAME and a
column named OID that have all my information in them. It's set up like this:
ST_NAME OID STREET_2 STREET_3 STREET_4
Leigh cv 22
Mays ln 22
Stoneridge 22
Russell 54
Makala 54

Where the OID are all the same, each of those streets need to be placed in a
seperate street column, instead of all being under ST_NAME. Leigh cv, Mays
Ln, and Stoneridge should occupy ST_NAME, STREET_2, and STREET_3 all in the
same row. I'm not sure how to set up functions for this.





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
copy of excel file not showing formulal/function in the function b oaallam Excel Discussion (Misc queries) 4 September 6th 07 01:20 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Offset function with nested match function not finding host ss. MKunert Excel Worksheet Functions 1 March 21st 06 10:46 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM
Nested IF Function, Date Comparing, and NetworkDays Function carl Excel Worksheet Functions 2 December 29th 04 09:57 PM


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