possible formula

Jesan

New Member
Joined
Mar 16, 2016
Messages
17
Office Version
  1. 2021
Platform
  1. Windows
Hi,

Thank you in advance. Is there a way to know some single excel formula for this table?
column Acolumn Bno. of items in column B=COUNTIF(A2:A10,A2)need result - sum of items in column C
111516503224
111516503224
030418501135
030418501235
030418501235
056418313146
056418313146
056418313246
056418313246
 
if this presentation works for you then Power Query

Book5
FGHI
1column Acolumn B2Count
211151650324
33041850135
45641831346
Sheet1


Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"column A", "column B", "2"}, {{"Count", each List.Sum([no. of items in column B]), type number}})
in
    #"Grouped Rows"
 
Upvote 0
Looking at the sample SUMIF shall be enough:
Excel Formula:
=SUMIF(A$2:A$10,A2,C$2:C$10)

Book1
ABCDEF
1column Acolumn Bno. of items in column B=COUNTIF(A2:A10,A2)need result - sum of items in column Cformula
21115165032244
31115165032244
4304185011355
5304185012355
6304185012355
7564183131466
8564183131466
9564183132466
10564183132466
Sheet5
Cell Formulas
RangeFormula
F2:F10F2=SUMIF(A$2:A$10,A2,C$2:C$10)
 
Upvote 0
Solution
This is perfect. Thank you. How about this one?


column Acolumn Bcolumn Ccolumn Dneed result
111516503ballpeenballpeenWith (1) paper
111516503ballpeenballpeenWith (1) paper
111516503ballpeenpaperWith (1) paper
30418501erasereraserWith (1) ballpeen and (2) pencil
30418501eraserballpeenWith (1) ballpeen and (2) pencil
30418501eraserpencilWith (1) ballpeen and (2) pencil
30418501eraserpencilWith (1) ballpeen and (2) pencil
56418313pencilballpeenWith (1) ballpeen, (1) board, (1) chalk, (1) eraser and (1) pentel pen
56418313pencileraserWith (1) ballpeen, (1) board, (1) chalk, (1) eraser and (1) pentel pen
56418313pencilboardWith (1) ballpeen, (1) board, (1) chalk, (1) eraser and (1) pentel pen
56418313pencilchalkWith (1) ballpeen, (1) board, (1) chalk, (1) eraser and (1) pentel pen
56418313pencilpentel penWith (1) ballpeen, (1) board, (1) chalk, (1) eraser and (1) pentel pen
 
Upvote 0
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’)

What is the logic for the desired results in post #5?
 
Upvote 0
I think it could go for counting items in column D which are different than in column C.
Having headers with names in row 1 it could be done (0 can be formattaed as non-displaying using custom format of the cell).

Book1
ABCDEFGHIJKL
1column Acolumn Bcolumn Ccolumn Dballpeenboardchalkeraserpaperpencilpentel penneed result
2111516503ballpeenballpeen0000100With (1) paper
3111516503ballpeenballpeen0000100With (1) paper
4111516503ballpeenpaper0000100With (1) paper
530418501erasereraser1000020With (1) ballpeen and (2) pencil
630418501eraserballpeen1000020With (1) ballpeen and (2) pencil
730418501eraserpencil1000020With (1) ballpeen and (2) pencil
830418501eraserpencil1000020With (1) ballpeen and (2) pencil
956418313pencilballpeen1111001With (1) ballpeen, (1) board, (1) chalk, (1) eraser and (1) pentel pen
1056418313pencileraser1111001With (1) ballpeen, (1) board, (1) chalk, (1) eraser and (1) pentel pen
1156418313pencilboard1111001With (1) ballpeen, (1) board, (1) chalk, (1) eraser and (1) pentel pen
1256418313pencilchalk1111001With (1) ballpeen, (1) board, (1) chalk, (1) eraser and (1) pentel pen
1356418313pencilpentel pen1111001With (1) ballpeen, (1) board, (1) chalk, (1) eraser and (1) pentel pen
Sheet1
Cell Formulas
RangeFormula
E2:K13E2=SUMPRODUCT(($A$2:$A$13=$A2)*($C$2:$C$13<>$D$2:$D$13)*($D$2:$D$13=E$1))
 
Upvote 0
Hi Kaper, Thank you for this. I would like to ask about the formula you use in column L?
1739967770675.png
 
Upvote 0
I would like to ask about ..
What about the question I asked?
What is the logic for the desired results in post #5?


Also, you did not act on my other suggestion. Therefore we still do not know what excel version(s) you are using so we do not know what functions and other features you have available. :cool:

Always best to make it as easy as possible for people to help you. ;)
 
Upvote 0
Hi Peter, sorry about the that, the excel i have is the 2021 version 2501, about the logic, i need to skip some steps to make it more faster.
 
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