Help Please - if range contains text then copy a different cell to another sheet

A_N_I_T_A

New Member
Joined
Apr 5, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
First time poster here,

I need a bit of help...
Basically I have a list of which days children attend and different teachers are responsible for each child's documentation so I want to make sure that each teacher has the correct number of children to report on.

What I want to do is if in Sheet 1 (attendance) column H3 to H19 contains the text "Teacher 1" then copy the text (child's name) from Sheet 1 B3:19 to Sheet 2 under the correct teacher. If it contains teacher 2 then copy that child's name to the teacher 2 list in Sheet 2.

I hope that makes sense ... any suggestions appreciated.

1617602108096.png


1617602441765.png
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Welcome to the MrExcel board!

I suggest that you investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with. It will generally get you faster and better responses.

See if this does what you want.

My sample data

A_N_I_T_A.xlsm
ABCDEFGH
1
2
3Child 1Teacher 2
4Child 2Teacher 1
5Child 3Teacher 2
6Child 4Teacher 3
7Child 5Teacher 3
8Child 6Teacher 2
9Child 7Teacher 2
10Child 8Teacher 1
11Child 9Teacher 3
12Child 10Teacher 2
13Child 11Teacher 2
14Child 12Teacher 1
15Child 13Teacher 4
16Child 14Teacher 3
17Child 15Teacher 3
18Child 16Teacher 3
19Child 17Teacher 4
Attendance


Copy the B3 formula across and the other results should automatically 'spill' down the columns.

A_N_I_T_A.xlsm
ABCDE
1
2Teacher 1Teacher 2Teacher 3Teacher 4
3Child 2Child 1Child 4Child 13
4Child 8Child 3Child 5Child 17
5Child 12Child 6Child 9
6Child 7Child 14
7Child 10Child 15
8Child 11Child 16
9
Documentation
Cell Formulas
RangeFormula
B3:B5,E3:E4,C3:D8B3=FILTER(Attendance!$B$3:$B$19,Attendance!$H$3:$H$19=B$2,"")
Dynamic array formulas.
 
Upvote 0
:) THANK YOU SO MUCH!!!!

Thanks Peter, I'll have to look in to how that formula works but for now i'm going to copy and paste it and use it because it works (and I don't really need to understand how right now ;)).
I'll also look in to getting XL2BB for future questions.

-Anita
 
Upvote 0
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,588
Members
449,039
Latest member
Arbind kumar

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