A'sri Idris
A'sri Idris

Reputation: 23

How do I create another column based on another columns in excel

I have 3 columns which looks quite like this

Trsntn 1 Status 1 Trsntn 2 Status 2
Payment1 Deliverd Payment1
Payment2 Failed Payment3
Payment3 Settled Payment2

So I want to fill the new data in Status 2 with the data from status 1 and sorted as in Trsntn 2.

Upvotes: 0

Views: 174

Answers (2)

Dominique
Dominique

Reputation: 17493

You need a simple VLookup(), like in this example:

enter image description here

The used function is:

=VLOOKUP(C2,A$2:B$4,2)

This means:

  • Look for value C2 (current cell)
  • Look into fix array A$2:B$4 (by fixing the array, the references won't change while dragging/dropping)
  • Inside the fix array, you need the value of the second column (hence the number 2)

Upvotes: 1

Harun24hr
Harun24hr

Reputation: 36770

Use simple SORT() function.

=@SORT(A2:C2,1,1,TRUE)

For dynamic array approach, try LAMBDA() function like-

=BYROW(A2:C4,LAMBDA(x,INDEX(SORT(x,1,1,TRUE),1,1)))

enter image description here

Upvotes: 1

Related Questions