Copy data from 5th column if data in previous 4 matches

UrosB

New Member
Joined
Aug 4, 2017
Messages
2
Hello,
This is my first post here and I'm relatively new to excel so hopefully somebody can help me.
I have workbook with 2 sheets (Sheet3 and Sheet4) in which one contains 4 columns and the other one contains 5 columns and I need a formula that will copy data from 5th column in second sheet to the first sheet if data in 4 cells in a row matches on both sheets. In the first sheet data starts in cell B4 and in second sheet it starts in cell A1 so data in column B in Sheet3 should match data in coulmn A on Sheet4 and so on and if there is match in all 4 cells in a row then it should copy data from 5th column.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Formulas can't copy data to other cells, you need VBA for that.

A cell can contain a value or a formula.
A cell can contain a value based on another cell but not copy a value to a cell.

This looks like a VBA solution may be required of which I'm no expert.
 
Last edited:
Upvote 0
Formulas can't copy data to other cells, you need VBA for that.

A cell can contain a value or a formula.
A cell can contain a value based on another cell but not copy a value to a cell.

This looks like a VBA solution may be required of which I'm no expert.

Ok, thank you for your response. I don't mind it being VBA or formula, I would just like not to do it manually as there is a lot of data.
 
Upvote 0
you can use SUMSIF() or SUMPRODUCT()
Code:
=SOMPRODUCT((B4=sheet4!$A$1:$A$21)*(C4=sheet4!$B$1:$B$21)*(D4=sheet4!$C$1:$C$21)*(E4=sheet4!$D$1:$D$21),sheet4!$E$1:$E$21)
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,286
Members
452,631
Latest member
a_potato

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