Need help creating an excel formula that will number my rows based on the number of records per clientID [duplicate] - excel

This question already has answers here:
Calculate Occurrence Number - Excel
(3 answers)
Closed 4 years ago.
I am looking to create an excel formula that will number my rows based on the number of times a clientID shows up.
Example:
column A (clientID) shows something like this
111
111
111
222
333
333
So I want a formula to put in column B (excel formula) so that it will appear like this:
1
2
3
1
1
2
(since 111 shows up 3 times, 222 shows up only once, and 333 shows up twice)
together the final result would be:
A B
111 1
111 2
111 3
222 1
333 1
333 2
Many thanks in advance for your help!!

maybe something like,
=countif(a$1:a1, a1)

Related

Sum rows with same values and write it in new cell

I have the following table:
OrderNumber
Value
123
2
123
3
333
5
333
6
555
8
555
9
My goal is to sum all OrderNumbers with the same values (e.g. for OrderNumber 123 the sum should be 5) and output the result in a new row.
The output should be like this:
OrderNumber
Value
Result
123
2
5
123
3
5
333
5
11
333
6
11
555
8
17
555
9
17
I've seen some formulas beginning with =SUM(A2:A6;A2;B2:B6). Important to me is that the searching criteria must be dynamically because my table has about 1k rows.
Do you have any references or suggestions?
You need SUMIF() function.
=SUMIF($A$2:$A$7,A2,$B$2:$B$7)
If you are a Microsoft 365 user then can try BYROW() for one go.
=BYROW(A2:A7,LAMBDA(x,SUMIF(A2:A7,x,B2:B7)))
This is the exact reason why the "Subtotals" feature has been invented:

Counting total number in Excel with a specific value in cells and a single column

Hope someone can help me out with what is probably quite a simple thing in Excel but I just can't seem to be able to work it out. I have a table of numbers which correspond to colour codes:
A
B
C
D
E
F
2
2
2
2
2
24
36
36
2
2
2
24
2
2
2
2
2
2
36
2
36
2
2
24
2
2
36
2
2
2
2
36
2
2
2
24
2
2
2
2
36
2
What I would like to able to have is some way of having a total based on the criteria:
Count the total number of times '36' appears in the table only if the row has '24' in column F
I've tried using COUNTIF and COUNTIFS but that only works for matching sized columns of data.
Any help would be really appreciated.
Use SUMPRODUCT:
=SUMPRODUCT((A1:E7=36)*(F1:F7=24))

vlookup with 2 columns in excel

I am having an issue with vlookup using 2 columns. I have the following 2 columns in my base excel sheet
ID_1 ID2
2 4
7 9
and my target sheet has these values
ID spend
2 20
4 30
7 10
1 5
9 10
When I run my vlookup, I would like to get this result
ID_1 ID2 Total_Spend
2 4 50
7 9 20
I am using something like this for Total_Spend, but it is not working..
=iferror(vlookup,0)+iferror(vlookup,0)
In this case you can use SUMIF()
Here the formula in D4 is:
=SUMIF($B$9:$B$13,B4,$C$9:$C$13)+SUMIF($B$9:$B$13,C4,$C$9:$C$13)

Excel to search 2 columns that have multiple the same but combined have only one output [duplicate]

This question already has an answer here:
Index- match not working
(1 answer)
Closed 5 years ago.
I have a unique building number and a unique room number.
But I have 240 buildings and looking to reference a unique space number.
Example :-
Building No. Room Number Unique reference
1 101 X132
1 102 A123
1 103 C123
1 104 B123
2 101 G123
2 102 D343
3 101 X111
So if i use Building 1 and room 103 = C123 been struggling with this for 24 hours so any help would be appreciated.
Enter as an array formula with Ctrl + Shift + Enter
=INDEX(C:C,MATCH("1"&"103",A:A&B:B,0),0)
Change 1 and 103 to cell references and limit the columns.

excel formula for same data but highest number

I need to know the formula for my data like this :
A B C
234 5
234 4
234 2
255 6
255 3
266 2
266 1
I want to mark same column C with 1 to those having same number in A but highest number in B. thank you.
I think this is what you are looking for
find max min value based on criteria

Resources