Profit and Loss Calculation

Nicholas Chew

New Member
Joined
Nov 2, 2014
Messages
11
Hi all,

I am creating a spreadsheet which show the profits of the month and year.

I having troubles doing this spreadsheet. Help me someone.

I have a dropdown list, Jan to Dec and Year 2013. I can choose any month or year then the page will show me the profits for the particular month or year. How do i do it?

Nicholas
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
You may want to do a combination of a SUMIFS like CharlesChuckieCharles mentioned, a dropdown list and a worksheet event.

Code:
[COLOR=#0000ff]Private Sub [/COLOR]Worksheet_Change([COLOR=#0000ff]ByVal[/COLOR] Target[COLOR=#0000ff] As[/COLOR] Range)
    
    Application.EnableEvents = [COLOR=#0000ff]False [/COLOR][COLOR=#008000]'Disable Events otherwise when we change the values the Event will Re-Trigger[/COLOR]
    Application.ScreenUpdating = [COLOR=#0000ff]False[/COLOR] [COLOR=#008000]'Turn Off ScreenUpdating[/COLOR]
    
    [COLOR=#0000ff]If [/COLOR]Target.Column = 2 [COLOR=#0000ff]Then[/COLOR]  [COLOR=#008000] 'If Target Column is B Then run the below procedure[/COLOR]
    
            Range("B2").Value = ""  [B][COLOR=#ff0000]'PUT YOUR SUMIFS FORMULA HERE[/COLOR][/B]
             
[COLOR=#0000ff]    End If[/COLOR]
   
    Application.EnableEvents = [COLOR=#0000ff]True[/COLOR][COLOR=#008000] 'Enable Events[/COLOR]
    Application.ScreenUpdating = [COLOR=#0000ff]True[/COLOR][COLOR=#008000] 'Turn On  ScreenUpdating[/COLOR]
    
[COLOR=#0000ff]End Sub[/COLOR]
 
Upvote 0

Forum statistics

Threads
1,222,759
Messages
6,168,052
Members
452,160
Latest member
Bekerinik

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