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:

Special-K99

Well-known Member
Joined
Nov 7, 2006
Messages
8,327
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:

Fazila

Board Regular
Joined
Nov 19, 2014
Messages
163
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.
 

Fazila

Board Regular
Joined
Nov 19, 2014
Messages
163
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 !
 

Fazila

Board Regular
Joined
Nov 19, 2014
Messages
163
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)),"")
 

Forum statistics

Threads
1,082,309
Messages
5,364,425
Members
400,802
Latest member
RichBRich

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top