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

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

FormR

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


Excel 2013
CDE
2Sleep @ MumsSleep @ MumsDuplicate
3Sleep @ MumsCovered
4Not Covered
Sheet1
Cell Formulas
RangeFormula
E2=CHOOSE(COUNTIF(C2:D2,"Sleep @ Mums")+1,"Not Covered","Covered","Duplicate")
 
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,749
Office Version
  1. 365
Platform
  1. Windows
Hi Izzy, glad that we were able to help out a little :)
 

Forum statistics

Threads
1,171,629
Messages
5,876,535
Members
433,199
Latest member
guerin47

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