copy cell if two criteria match

Fazila

Board Regular
Joined
Nov 19, 2014
Messages
163
OK I have a table that looks something like this:

ABCDEFGHIJ
SurnameForenameUPNTypePointsTalking when the teachers talkingEquipmentHomeworkDisruption to LearningAttitude to Learning
AashirMuhammadDXxxxTalking when the teachers talking1
DXxxxEqupment1
AbdillahiYaqubEXxxxHomework1
EXxxxDisruption to learning2

<tbody>
</tbody>

On another sheet I have a table that has the UPN and columns F to J. If the UPN matches and the type matches the column headings then I want the points to go into the relevant column.

Really hope this makes sense, any thoughts on how I can do this? VBA or formula would be really helpful.

Thanks
 
Last edited:

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
I dont think this is what you want but you only said for the figure to go into the relevant COLUMN, nothing about ROW

1. Correct your mistake in D3, it says Equpment and does not match G1 (Equipment).

2. in F2
=IF(COLUMN()-5=MATCH($D2,$F$1:$J$1,0),$E2,"")
copy acrosss and down the table
 
Last edited:
Upvote 0
I dont think this is what you want but you only said for the figure to go into the relevant COLUMN, nothing about ROW

1. Correct your mistake in D3, it says Equpment and does not match G1 (Equipment).

2. in F2
=IF(COLUMN()-5=MATCH($D2,$F$1:$J$1,0),$E2,"")
copy acrosss and down the table

Sorry Special-K99 couldn't get this to work.

To clarify I have a spreadsheet which has anything between 1 to 20 rows per student each row has a certain type of behaviour incident and the number of points allocated. For each year group I have a data sheet and a behaviour sheet. My data sheet consists of say:

Surname
Forename
UPN
All the different types of behaviour incidents (in separate columns so column D to AP), a sample of which has been posted above.

in the Data sheet for each student I want to know the number of behaviour points they have under each category so Muhammed Aashir has 1 behaviour point for Talking when the teachers talking and 1 behaviour point for Equipment. On the Data sheet therefore in row 2 I need column D and E to have the number 1.

I need the UPNs to match so the data is pasted against the correct student as in the Behaviour sheet 1 student could have any number of rows.

Really hope this make sense and thank you for helping.
 
Upvote 0
Code:
=INDEX('Year 7 Behaviour'!$E$2:$E$2661,MATCH('Year 7 Data'!$C2,'Year 7 Behaviour'!$C$2:$C$2661,0),MATCH('Year 7 Data'!Q$1,'Year 7 Behaviour'!$D$2:$D$2661,0))

This formula works but only for the first column when I try in the next category it returns #REF !
 
Upvote 0
this formula worked thought I would post for future reference :)

=IFERROR(INDEX(BehaviourPoints,MATCH(1,($C2=UPNBehaviour)*(Q$1='Year 7 Behaviour'!$D$2:$D$2661),0)),"")
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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