How to draw data from one column based on a vale match to another column.

dwpfreak

New Member
Joined
Feb 22, 2008
Messages
33
Hi, I have a data sheet where I need to draw out all the values in one column that match a specific criteria set in another.
I have data in worksheets Outgoings/income and I want to draw all the outgoing/income values from those two sheets based on whether it matches the week value. Maximum of 52 weeks.
So if column 4 (Column E) Week Value says '1', then the value in the same row is summed.
But I need it to count (Sum) all values in every row where number 1 is in column E (Week).
Effectively I am just trying to count all outgoings in Week 1, Week 2 etc etc, and then do the same with Income with same week No criteria.
The results need to go into a worksheet called 'Weekly Report' table so I can build reports.
PS I would like this to automatically count and report without having to press enter on a cell. VBA code most welcomed, I have a VBA that builds the database already so could be linked to the button press to record an entry.
Thank you, sorry if that is not clear, happy to clarify anything.
Best
J
 

Attachments

  • Range value Excel.png
    Range value Excel.png
    13.7 KB · Views: 10
maybe
sum(filter() ) should do that - for a sum
rows(filter() ) for a count

something like
sum(filter(C2:C100, E2:E100=1) )

ROWS(filter(C2:C100, E2:E100=1) ) or you could just SUMIF(E2:E100,1)

Book2
ABCDEFGH
1SUMCOUNT
220016502
3300
44501
5600
Sheet1
Cell Formulas
RangeFormula
G2G2=SUM(FILTER(C2:C100, E2:E100=1) )
H2H2=ROWS(FILTER(C2:C100, E2:E100=1) )


What version of excel are you using - would be worth updating your profile to show version as solutions will be dependant on what version you have and therefore what functions available

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)


Note: Images are difficult to see , and also requires that I input all the data myself, which means I may make an error, which is very time consuming, and from my point of view less likely to get a response, if a complicated spreadsheet. Plus we cannot see any of the formulas used.

Therefore -

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

This will possibly enable a quicker and more accurate solution for you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone
 
Upvote 0
OR
just
for the SUM =SUMIF(E2:E5,1,C2:C5)
for the count =SUMIF(E2:E5,1)

Book2
ABCDEFGHIJK
1SUMCOUNTSUMCount
2200165026502
3300
44501
5600
Sheet1
Cell Formulas
RangeFormula
G2G2=SUM(FILTER(C2:C100, E2:E100=1) )
H2H2=ROWS(FILTER(C2:C100, E2:E100=1) )
J2J2=SUMIF(E2:E5,1,C2:C5)
K2K2=SUMIF(E2:E5,1)
 
Upvote 0

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