rajdeepkhurana
New Member
- Joined
- Aug 29, 2017
- Messages
- 1
Hi Experts,
Heres my query and thank you in advance for your help.
TABLE 1
===
I have a list of sales transactions.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Date[/TD]
[TD]Item #[/TD]
[TD]Revenue[/TD]
[TD]Cost[/TD]
[TD]Profit[/TD]
[/TR]
[TR]
[TD]17 feb 2017[/TD]
[TD]568[/TD]
[TD]$100[/TD]
[TD]$70[/TD]
[TD]30[/TD]
[/TR]
[TR]
[TD]18 Feb 2017[/TD]
[TD]439[/TD]
[TD]$120[/TD]
[TD]$130[/TD]
[TD]-10[/TD]
[/TR]
[TR]
[TD]01 Mar 2017[/TD]
[TD]439[/TD]
[TD]$150[/TD]
[TD]$130[/TD]
[TD]20[/TD]
[/TR]
</tbody>[/TABLE]
TABLE 2
===
I have another table that records the costs of each item.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Item #[/TD]
[TD]Shipping Cost[/TD]
[TD]Direct Cost[/TD]
[TD]Total Cost[/TD]
[/TR]
[TR]
[TD]568[/TD]
[TD]20[/TD]
[TD]50[/TD]
[TD]$70[/TD]
[/TR]
[TR]
[TD]439[/TD]
[TD]80[/TD]
[TD]50[/TD]
[TD]$130[/TD]
[/TR]
</tbody>[/TABLE]
I currently use the Index and Match function to fetch the cost of the item # from Table 2
Here's the problem:
Due to changing market, lets say the the cost of procuring item 439 changes. My old profit should not change. How do i fetch the new cost in the subsequent transactions? In my current scenario, if I change the cost for item 439 in Table 2, profit in all previous transactions will change, which is not what i want.
Solution :
What I want is a macro where I input the start date and end date of the sales transactions. It would then update the cost only for those transactions. This way, my old transactions and their profit figures don't change. Can anyone help with this macro?
I would be open to any other suggestions.
Thank you so much!!
Heres my query and thank you in advance for your help.
TABLE 1
===
I have a list of sales transactions.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Date[/TD]
[TD]Item #[/TD]
[TD]Revenue[/TD]
[TD]Cost[/TD]
[TD]Profit[/TD]
[/TR]
[TR]
[TD]17 feb 2017[/TD]
[TD]568[/TD]
[TD]$100[/TD]
[TD]$70[/TD]
[TD]30[/TD]
[/TR]
[TR]
[TD]18 Feb 2017[/TD]
[TD]439[/TD]
[TD]$120[/TD]
[TD]$130[/TD]
[TD]-10[/TD]
[/TR]
[TR]
[TD]01 Mar 2017[/TD]
[TD]439[/TD]
[TD]$150[/TD]
[TD]$130[/TD]
[TD]20[/TD]
[/TR]
</tbody>[/TABLE]
TABLE 2
===
I have another table that records the costs of each item.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Item #[/TD]
[TD]Shipping Cost[/TD]
[TD]Direct Cost[/TD]
[TD]Total Cost[/TD]
[/TR]
[TR]
[TD]568[/TD]
[TD]20[/TD]
[TD]50[/TD]
[TD]$70[/TD]
[/TR]
[TR]
[TD]439[/TD]
[TD]80[/TD]
[TD]50[/TD]
[TD]$130[/TD]
[/TR]
</tbody>[/TABLE]
I currently use the Index and Match function to fetch the cost of the item # from Table 2
Here's the problem:
Due to changing market, lets say the the cost of procuring item 439 changes. My old profit should not change. How do i fetch the new cost in the subsequent transactions? In my current scenario, if I change the cost for item 439 in Table 2, profit in all previous transactions will change, which is not what i want.
Solution :
What I want is a macro where I input the start date and end date of the sales transactions. It would then update the cost only for those transactions. This way, my old transactions and their profit figures don't change. Can anyone help with this macro?
I would be open to any other suggestions.
Thank you so much!!