if either column contains specific text add a word to another column..

IsabellaLearning

Board Regular
Joined
May 23, 2009
Messages
115
Hi all,


I am doing a roster to cover sleepovers at mums place as she is unwell.


Column C contains my brothers availability
Column D contains my availability
availability is text "Sleep @ Mums"


In Column E I want to add the text"COVERED" IF either column C OR column D contains the text "Sleep @ Mums"
Also if both column C and column D contain "sleep at mums" on same line" text to say "duplicate"

Would be most appreciative!

Thanks
Izzy
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

FormR

MrExcel MVP
Joined
Aug 18, 2011
Messages
6,518
Office Version
  1. 365
Platform
  1. Windows
Hi, here is one possibility:

<b>Excel 2013</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #BBB"><colgroup><col width="25px" style="background-color: #DAE7F5" /><col /><col /><col /></colgroup><thead><tr style=" background-color: #DAE7F5;text-align: center;color: #161120"><th></th><th>C</th><th>D</th><th>E</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">2</td><td style="color: #333333;;">Sleep @ Mums</td><td style="color: #333333;;">Sleep @ Mums</td><td style="background-color: #FFFF00;;">Duplicate</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="color: #333333;;">Sleep @ Mums</td><td style="text-align: right;;"></td><td style=";">Covered</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style=";">Not Covered</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 #BBB;border-top:none;text-align: center;background-color: #DAE7F5;color: #161120">Sheet1</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: #BBB"><thead><tr style=" background-color: #DAE7F5;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: #DAE7F5;color: #161120">E2</th><td style="text-align:left">=CHOOSE(<font color="Blue">COUNTIF(<font color="Red">C2:D2,"Sleep @ Mums"</font>)+1,"Not Covered","Covered","Duplicate"</font>)</td></tr></tbody></table></td></tr></table><br />
 
Joined
Jul 7, 2015
Messages
44
In cell E1, enter the following formula and close it with Ctrl + Shift + Enter in stead of just Enter (it's an array formula) and drag it down.

Code:
=CHOOSE(SUM(--ISTEXT(C1:D1))+1,"Not Covered","Covered","Duplicate")

I'm assuming you want something like "Not Covered" in rows with no entries in either column C or D. If you just want it to be blank, remove the actual text between the double quotation marks in the formula.
 

IsabellaLearning

Board Regular
Joined
May 23, 2009
Messages
115
Hi, here is one possibility:

Excel 2013
CDE
2Sleep @ MumsSleep @ MumsDuplicate
3Sleep @ MumsCovered
4Not Covered

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
E2=CHOOSE(COUNTIF(C2:D2,"Sleep @ Mums")+1,"Not Covered","Covered","Duplicate")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>


absoutely perfect - thankyou so much - i feel like i have been attempting the basics and getthign them wrong for years - i really appreciate your help! thankyou and have a gorgeous weekend!

Izzy
 

IsabellaLearning

Board Regular
Joined
May 23, 2009
Messages
115
Thankyou also Mathias - the 2 of you have my roster on track and another worry of my mind - im greatful and youve made my day!
 

FormR

MrExcel MVP
Joined
Aug 18, 2011
Messages
6,518
Office Version
  1. 365
Platform
  1. Windows
Hi Izzy, glad that we were able to help out a little :)
 

Watch MrExcel Video

Forum statistics

Threads
1,133,532
Messages
5,659,365
Members
418,499
Latest member
mbcmel

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
Top