Hi, i have 2 columns, the first one is a text column, the second is a number column, i would like to sum all values to the second column that the text in the first column beggins from specific characters
Hi, i have 2 columns, the first one is a text column, the second is a number column, i would like to sum all values to the second column that the text in the first column beggins from specific characters
Well, your description is very general - it is better to refer to specific cells/columns/rows so that we can give you a proposal to suit the layout of your data.
You should be able to use SUMIF for this. The general syntax for you will be:
=SUMIF( criteria_range ; criteria ; sum_range)
Hope this helps.
Pete
Note that you can use wildcard characters with SUMIF, so if you just wanted to look for the first 3 characters, for example "abc", then your criteria would be:
"abc*"
Hope this helps.
Pete
I thing it doesn't work because the first 3 characters of a text looks like number (is 123)
It is like 123456 10
123567 20
124444 30
And i use formula sumif(A:A,left(A1,3),B:B)
Sorry...
It is like
123456 10
123567 20
124444 30
And i use formula sumif(A:A,left(A1,3),B:B)
Attach a sample workbook - you can find details of how to do this in the yellow banner at the top of the screen.
Pete
You must include the asterisk, like this:
sumif(A:A,left(A1,3)&"*",B:B)
Hope this helps.
Pete
Pete Thanks but ir still returns 0
Last edited by AliGW; 12-11-2020 at 07:50 AM. Reason: PLEASE don't quote unnecessarily!
Act upon my comments in post #7, then.
Pete
Think that i have already done it, realy don't know how it works with attachments
Please note that Greek excel uses ";" instead of ","
Regards
D1=sumproduct((left(a1:a3,3)+0=123)*(b1:b3))
Here's another approach for D1:
=SUMPRODUCT(--(INT(A$1:A$3/1000)&""=LEFT(A1;3));B$1:B$3)
You can't use wildcards with numbers, and you can't manipulate the criteria_range within SUMIF, so you need to use SUMPRODUCT.
Hope this helps.
Pete
Glad we finally got there - hopefully you can now see the advantages of attaching a sample workbook.
If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.
You might also like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).
Pete
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks