ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Create alternate line of data (https://www.excelbanter.com/excel-worksheet-functions/173465-create-alternate-line-data.html)

Excel Helps

Create alternate line of data
 
Hello again,
Is it possible to create alternating lines of data using a function, based
on a preceding line?
I need to add simaler products underneath each line of existing data to add
the wood type oak.

Code Name Wood Wood_Image
A1 Chair Pine pine.jpg

A2 Chair Pine pine.jpg

This line to be added inbetween A1 and A2
A1_OAK Chair Oak oak.jpg

Thanks.




Pete_UK

Create alternate line of data
 
You can't do this with a formula, as a formula cannot insert rows -
you would need a macro to do it.

An alternative approach you might be able to take would be to add some
formulae at the bottom of your data, fix the values, and then sort the
table. For example, if your data is currently on rows 2 to 30, then in
row 31 you could have these formulae and values:

A31: =A2&"_OAK"
B31: =B2
C31: OAK
D31: oak.jpg

Then you could copy A31:D31 into rows 32 to 59, and then highlight
A31:D59, click <copy, then Edit | Paste Special | Values | OK and
<Esc. Then sort the complete table using column A as the sort field.

Hope this helps.

Pete

On Jan 17, 3:13*pm, Excel Helps
wrote:
Hello again,
Is it possible to create alternating lines of data using a function, based
on a preceding line?
I need to add simaler products underneath each line of existing data to add
the wood type oak.

Code * *Name * *Wood * *Wood_Image
A1 * * *Chair * Pine * *pine.jpg

A2 * * *Chair * Pine * *pine.jpg

This line to be added inbetween A1 and A2
A1_OAK * * Chair * * * * Oak * * * * *oak.jpg

Thanks.



Excel Helps

Create alternate line of data
 
Cheers Pete,
I'll try that and also a macro and see what works best.

"Pete_UK" wrote:

You can't do this with a formula, as a formula cannot insert rows -
you would need a macro to do it.

An alternative approach you might be able to take would be to add some
formulae at the bottom of your data, fix the values, and then sort the
table. For example, if your data is currently on rows 2 to 30, then in
row 31 you could have these formulae and values:

A31: =A2&"_OAK"
B31: =B2
C31: OAK
D31: oak.jpg

Then you could copy A31:D31 into rows 32 to 59, and then highlight
A31:D59, click <copy, then Edit | Paste Special | Values | OK and
<Esc. Then sort the complete table using column A as the sort field.

Hope this helps.

Pete

On Jan 17, 3:13 pm, Excel Helps
wrote:
Hello again,
Is it possible to create alternating lines of data using a function, based
on a preceding line?
I need to add simaler products underneath each line of existing data to add
the wood type oak.

Code Name Wood Wood_Image
A1 Chair Pine pine.jpg

A2 Chair Pine pine.jpg

This line to be added inbetween A1 and A2
A1_OAK Chair Oak oak.jpg

Thanks.




Pete_UK

Create alternate line of data
 
Glad to be of help.

You could apply the method I suggest by means of a macro, and it
should be quicker if you have a lot of data items (inserting single
rows can be time-consuming).

Pete

On Jan 17, 5:44*pm, Excel Helps
wrote:
Cheers Pete,
I'll try that and also a macro and see what works best.



"Pete_UK" wrote:
You can't do this with a formula, as a formula cannot insert rows -
you would need a macro to do it.


An alternative approach you might be able to take would be to add some
formulae at the bottom of your data, fix the values, and then sort the
table. For example, if your data is currently on rows 2 to 30, then in
row 31 you could have these formulae and values:


A31: * *=A2&"_OAK"
B31: * *=B2
C31: * *OAK
D31: * *oak.jpg


Then you could copy A31:D31 into rows 32 to 59, and then highlight
A31:D59, click <copy, then Edit | Paste Special | Values | OK and
<Esc. Then sort the complete table using column A as the sort field.


Hope this helps.


Pete


On Jan 17, 3:13 pm, Excel Helps
wrote:
Hello again,
Is it possible to create alternating lines of data using a function, based
on a preceding line?
I need to add simaler products underneath each line of existing data to add
the wood type oak.


Code * *Name * *Wood * *Wood_Image
A1 * * *Chair * Pine * *pine.jpg


A2 * * *Chair * Pine * *pine.jpg


This line to be added inbetween A1 and A2
A1_OAK * * Chair * * * * Oak * * * * *oak.jpg


Thanks.- Hide quoted text -


- Show quoted text -




All times are GMT +1. The time now is 12:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com