Formula which looks across Column for and with same value then applies formula

tomcavs

New Member
Joined
Dec 11, 2018
Messages
8
Hi,

I require a function which looks at a ID in a certain column and only compares values across respective rows for that ID:

1) Function looks at cells containing the same ID
2) Looks at which currency is first alphabetically and then if PAY or REC to determine the Buyer

Issue I am having is restricting the formula to just check across Rows where the ID is the same when dragging down the column

[TABLE="width: 225"]
<tbody>[TR]
[TD][TABLE="width: 289"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Currency[/TD]
[TD]Value[/TD]
[TD]Buyer[/TD]
[/TR]
[TR]
[TD]503[/TD]
[TD]CAD[/TD]
[TD]REC[/TD]
[TD]Buyer[/TD]
[/TR]
[TR]
[TD]503[/TD]
[TD]USD[/TD]
[TD]PAY[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]503[/TD]
[TD]CAD[/TD]
[TD]PAY[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]503[/TD]
[TD]USD[/TD]
[TD]REC[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]504[/TD]
[TD]CAD[/TD]
[TD]PAY[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]504[/TD]
[TD]USD[/TD]
[TD]REC[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]504[/TD]
[TD]CAD[/TD]
[TD]REC[/TD]
[TD]Buyer[/TD]
[/TR]
[TR]
[TD]504[/TD]
[TD]USD[/TD]
[TD]PAY[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Thanks,
Tom
 
sorry ignore above...

Formula looks good. except the Buy / Sell is an output field. I need to formula to look at Currency vs. PAY / REC.

I need to ascertain the buyer and the buyer is the Entity which receives (REC) the currency that is first alphabetically.

 
Upvote 0

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
sorry ignore above...

Formula looks good. except the Buy / Sell is an output field. I need to formula to look at Currency vs. PAY / REC.

I need to ascertain the buyer and the buyer is the Entity which receives (REC) the currency that is first alphabetically.


You mean the condition must be REC, not Buy?
 
Upvote 0
One more additional query, how can I vlookup so that blanks are ignored in a list of transaction numbers (dupes removed):

[TABLE="width: 377"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Input[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Ref Number[/TD]
[TD]Buyer ID[/TD]
[/TR]
[TR]
[TD]D10517422[/TD]
[TD]G123456[/TD]
[/TR]
[TR]
[TD]D10517422[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]D20517422[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]D20517422[/TD]
[TD]T1123456[/TD]
[/TR]
[TR]
[TD]D10517423[/TD]
[TD]G123456[/TD]
[/TR]
[TR]
[TD]D10517423[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Output[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Ref Number[/TD]
[TD]Buyer ID[/TD]
[/TR]
[TR]
[TD]D10517422[/TD]
[TD]G123456[/TD]
[/TR]
[TR]
[TD]D20517422[/TD]
[TD]T123456[/TD]
[/TR]
[TR]
[TD]D10517423[/TD]
[TD]G123456[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Book1
ABCDEF
1InputOutput
2Ref NumberBuyer IDRef NumberBuyer ID
3D10517422G123456D10517422G123456
4D10517422D20517422T1123456
5D20517422D10517423G123456
6D20517422T1123456
7D10517423G123456
8D10517423
Sheet1


In F3 control+shift+enter, not just enter, and copy down:

=INDEX($B$3:$B$8,SMALL(IF($A$3:$A$8=E3,IF($B$3:$B$8<>"",ROW($B$3:$B$8)-ROW($B$3)+1)),COUNTIFS($E$3:E3,E3)))
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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