Common value key/relationship between 2 cells

And21

New Member
Joined
Sep 23, 2022
Messages
11
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hi all,

I have built a report with some financial transactions checking.

The scenario is, (col A) company "1" sends money to (col B) company "2" so the common value in column C will be "12" (cell A & cell B).
But if the company "2" sends money to "1" then in column C we will have "21".

What I need is a formula in a new column that identifies the relationship between the companies and returning back a common value.
For example, IF column A & column B = 12 then return 12
and IF column A & column B = 21 then return again 12 ( and not 21)


Screenshot 2022-09-23 at 6.04.04 PM.png



I hope that my description is clear.

Thank you,
 
How about
Excel Formula:
=MIN(A2,B2)&MAX(A2,B2)
 
Upvote 0
Solution

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Nop, because for example the last row in column E should give us a common value (the same as the above: 60604040).
 
Upvote 0
In the example you last quoted, second last row has different sender and receiver codes else formula is working fine. Check that.
Nop, because for example the last row in column E should give us a common value (the same as the above: 60604040).
 
Upvote 0
How about
Excel Formula:
=MIN(A2,B2)&MAX(A2,B2)
Hi, interesting, in the testing file it seems fine.
I will test it also in the real scenario to see if it works.
thanks
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
Not creating any controversy as I have learnt so much from @Fluff in this forum itself. But just to mention and for your understanding -

The formula I initially gave
Excel Formula:
=IF(B2>A2,A2&B2,B2&A2)
and the formula @Fluff gave
Excel Formula:
=MIN(A2,B2)&MAX(A2,B2)

shall produce exactly same results. Same thing presented using different formula.

Check this -

Book1.xlsx
ABCD
1Party 1 Party 2SGMFluff
2404050504040505040405050
3505040404040505040405050
4909060606060909060609090
5606090906060909060609090
Sheet2
Cell Formulas
RangeFormula
C2:C5C2=IF(B2>A2,A2&B2,B2&A2)
D2:D5D2=MIN(A2,B2)&MAX(A2,B2)
 
Upvote 0
Not creating any controversy as I have learnt so much from @Fluff in this forum itself. But just to mention and for your understanding -

The formula I initially gave
Excel Formula:
=IF(B2>A2,A2&B2,B2&A2)
and the formula @Fluff gave
Excel Formula:
=MIN(A2,B2)&MAX(A2,B2)

shall produce exactly same results. Same thing presented using different formula.

Check this -

Book1.xlsx
ABCD
1Party 1 Party 2SGMFluff
2404050504040505040405050
3505040404040505040405050
4909060606060909060609090
5606090906060909060609090
Sheet2
Cell Formulas
RangeFormula
C2:C5C2=IF(B2>A2,A2&B2,B2&A2)
D2:D5D2=MIN(A2,B2)&MAX(A2,B2)
Hi Sanjay,

Indeed, it works as well. I really appreciate spending your time to help on this. Thank you!
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,217
Members
452,619
Latest member
Shiv1198

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