Like this:
search one here OR search two here
| eval txnrefno=coalesce('txn ref no', txnrefno)
| eval acctno=coalesce('acct no', acctno)
| fields amount date acctno txnrefno
| stat values(*) AS * BY acctno txnrefno
@nvegesn222 - Can you provide the search that you used? That would be helpful for users attempting to assist you in how you got your initial output and how you want your output to look like.
In general, your question has a greater chance of being answered by experts in the Answers community when when you provide as much information and context as possible. Thanks.