Excel Macro Help Finding Specific Values

byt2vhl

New Member
Joined
Jun 17, 2015
Messages
1
Hey all,

I'm new to this site and this is my first post, but I cant figure out what code to use for the following problem:

I have a sheet with the following 5 columns:
Acct #, Month, Year, Type A or B, and $ Amount.

Basically, what I want to do is sum up the $ amounts for Type A and B (separately), but only if it the account number is 280, the month is last month, and the year is the current year. I then want to paste this on another sheet.

I've looked through a bunch of threads and I can't seem to find anything. Help would be greatly appreciated.

Thanks!
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
I think you can use pivot table for this.

Select your data and create pivot table (Insert -> PivotTable). Then choose Type as Row Labels and Account, Month, Year as Report Filters. Amount should go to Values with Sum as summary setting.

Once table is created, apply value filters in Account, Month and Year filter drop-downs.
 
Upvote 0
Hi,

How you do this depends upon what you actually have in the Month and year columns. Are they numbers i.e. 1 thru 12 for the month and (say) 2015 for the year or are they properly formatted dates?
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,241
Members
449,075
Latest member
staticfluids

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