sum one column based on another

scalvitto0815

New Member
Joined
Sep 7, 2023
Messages
9
Office Version
  1. 365
Platform
  1. Windows
i have 100 lines of data A10 to B 10 col A has code numbers and column B has amounts. Is there a foruma i can enter in b2 that will give me the sum of allamounts in Col B based on the fiorst position of the codes in Col A. I would like to enter the code in A1
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
a sumif() may help or sumifs()

SUMIF(B2,B10,A2:A10,A1)

but i'm not sure i follow exactly what you are after

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
Capture.GIF
 
Upvote 0
this is sample data
That returned 0. It needs to use only the first position of the codes in a12:a17
 
Upvote 0
this is sample data
I checked it was returning 0 for some reason unknown to me. That's why I asked the kind of code you have.

If you can share actual data type would help better. Also, the kind of criteria you want to total on...
 
Upvote 0
i got it to almost work. cells a12:a17 are numbers. cell a1 is a number. it is not returnong an answer in b1.
If i put an ' in the front of the codes, then it works, but I dont want to have to do that because the cosdes are coming from somplace else
 
Upvote 0
I checked it was returning 0 for some reason unknown to me. That's why I asked the kind of code you have.

If you can share actual data type would help better. Also, the kind of criteria you want to total on...
i cant get the add in to work thats why i posted a pic
 
Upvote 0

Forum statistics

Threads
1,215,327
Messages
6,124,292
Members
449,149
Latest member
mwdbActuary

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