Need to assign value to one transaction per day value condition on multiple text field

Partha Speaks

New Member
Joined
Jan 27, 2020
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hello Experts,
I am having trouble in calculating a the 'final value' column in the below table. Imagine you have a text column 'sample_card' which has multiple transactions over a month. Now, a particular card is eligible for one txn per day only. Maximum discount VALUE PER TXN is set at 75. I have to determine what value a particular card is eligible for discount.
I have more than 30000 such records. Need some formula to get the column 'Final_value'.

I have tried using countif, it didn't work. I tried concatenating date and sample_card , and then countif (sample_card all colum, cample_card that row's column). It didn't work.
Kindly help.

row nosample_carddatetxn discount passedMAX DISCOUNT VALUEfinal value
1​
0002357838937492324
2-Oct-19​
50​
75​
50​
2​
0002357838937492324
2-Oct-19​
40​
75​
0​
3​
0002357838937492324
5-Oct-19​
70​
75​
70​
4​
0001675759313894932
12-Oct-19​
80​
75​
75​
5​
0001675759313894932
12-Oct-19​
50​
75​
0​
6​
0001675759313894932
15-Oct-19​
30​
75​
0​
6​
0001675759313894932
15-Oct-19​
70​
75​
70​
6​
0001675759313894932
2-Oct-19​
40​
75​
40​
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
You have 3 row 6's ... and the second one gets a non-zero value, but the first one gets a zero .... why does the first one get the zero for that day?
 
Upvote 0
Hi please ignore row number. it should 6, 7, 8.
the second row gets non-zero because if you look at the date 15th Oct., it has 2 txn and maximum discount row needs to be given the value and thus its non-zero, & the other one as zero
 
Upvote 0
Can you sort the data on Sample Card (ascending), Date (ascending), and Txn Discount Passed (descending)?
 
Upvote 0
Can you sort the data on Sample Card (ascending), Date (ascending), and Txn Discount Passed (descending)?
how do I do that using some algorithm in python or SAS?
its a large transaction file and I need to select each day's max discount for a card. please help.
 
Upvote 0
how do I do that using some algorithm in python or SAS?
its a large transaction file and I need to select each day's max discount for a card. please help.
How do you do that? Use the Data Sort functionality of Excel.

So, can you do that to your data? If not, why not?
 
Upvote 0

Forum statistics

Threads
1,214,621
Messages
6,120,563
Members
448,972
Latest member
Shantanu2024

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