Find equal values in two ranges and get their positions and..(hard to explain)

salati

New Member
Joined
Sep 9, 2014
Messages
1
Hi,
I am new to VBA and to the forum as well. And I can´t find a way to solve this simple warehouse problem:
Capture.jpg


All columns are obtained from another Workbook, so the dates, values and range sizes will change from time to time. The first date column is just a daily sequence. The second date column are the dates when material got in or out the warehouse. I actualy only don´t have the colored balance information, which is the balance in each day. I want a code that considers the second balance column and put them into the colored range. Any ideas?
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Putting in B4 the following formula then drag down. It should give the right results and you won't need Balance in column F

Code:
=B3+SUMPRODUCT(($C$4:$C$12<=A4)*($C$4:$C$12>A3),--($D$4:$D$12="in"),$E$4:$E$12)-SUMPRODUCT(($C$4:$C$12<=A4)*($C$4:$C$12>A3),--($D$4:$D$12="out"),$E$4:$E$12)

the row 3 need to be present with no data in A3 and starting Balance in B3 or 0

Hope it works as intented.
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,214
Members
449,074
Latest member
cancansova

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