Returning Concatenated cells based on criteria

Ride The Lightning

Board Regular
Joined
Jul 14, 2005
Messages
238
Hi

I have 2 columns of data:

(B) "Book", (blank cell), (blank cell), (blank cell), "Book", (blank cell), "Book"
(C) 1, 2, 3, 4, 2, 1, 3

I am tring to write a formula to operate in Column A that checks if Column B contains "Book". If it does, I want to concatenate the cell "Book" is in and the adjacent cell in Column C. If it does not contain "Book" (i.e. blank) I want to return the most recent Concatenated cells containing "Book".

So Column (A) should read: Book1, Book1, Book1, Book1, Book2, Book2, Book3.

Would appreciate some help on how to achieve this.

Thanks

RTL
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
try this
<b>Excel 2007</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style=";">Book1</td><td style=";">Book</td><td style="text-align: right;;">1</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style=";">Book1</td><td style="text-align: right;;"></td><td style="text-align: right;;">2</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style=";">Book1</td><td style="text-align: right;;"></td><td style="text-align: right;;">3</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style=";">Book1</td><td style="text-align: right;;"></td><td style="text-align: right;;">4</td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style=";">Book2</td><td style=";">Book</td><td style="text-align: right;;">2</td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style=";">Book2</td><td style="text-align: right;;"></td><td style="text-align: right;;">1</td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style=";">Book3</td><td style=";">Book</td><td style="text-align: right;;">3</td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">Sheet2</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">A1</th><td style="text-align:left">=IF(<font color="Blue">B1="Book",B1&C1</font>)</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">A2</th><td style="text-align:left">=IF(<font color="Blue">B2="Book",B2&C2,A1</font>)</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">A3</th><td style="text-align:left">=IF(<font color="Blue">B3="Book",B3&C3,A2</font>)</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">A4</th><td style="text-align:left">=IF(<font color="Blue">B4="Book",B4&C4,A3</font>)</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">A5</th><td style="text-align:left">=IF(<font color="Blue">B5="Book",B5&C5,A4</font>)</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">A6</th><td style="text-align:left">=IF(<font color="Blue">B6="Book",B6&C6,A5</font>)</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">A7</th><td style="text-align:left">=IF(<font color="Blue">B7="Book",B7&C7,A6</font>)</td></tr></tbody></table></td></tr></table><br />
 
Upvote 0
Hi

I have 2 columns of data:

(B) "Book", (blank cell), (blank cell), (blank cell), "Book", (blank cell), "Book"
(C) 1, 2, 3, 4, 2, 1, 3

I am tring to write a formula to operate in Column A that checks if Column B contains "Book". If it does, I want to concatenate the cell "Book" is in and the adjacent cell in Column C. If it does not contain "Book" (i.e. blank) I want to return the most recent Concatenated cells containing "Book".

So Column (A) should read: Book1, Book1, Book1, Book1, Book2, Book2, Book3.

Would appreciate some help on how to achieve this.

Thanks

RTL
What results do you expect if this is your data:

Book1
BC
1_1
2_2
3_3
4_4
5Book2
6_1
7Book3
Sheet1
 
Upvote 0

Forum statistics

Threads
1,224,516
Messages
6,179,231
Members
452,898
Latest member
Capolavoro009

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top