please don't create incomplete guides like this one here with a misleading formula. what you have found on the internet belongs to many years ago where bitcoin only had 1 type of transactions with 2 type of public keys (compressed and uncompressed)
My bad, I am fairly new in this space and had no idea that fee can vary for legacy and segwit address. Had no idea for more input, I have to pay more fee. I got another thread about future fee of bitcoin transaction and this question peek at my mind that how fee is actually calculated. I was redirected to an article, was probably an old one which had referred to this method only.
Anyway, this is help and beginners board, beginners can do some mistakes. I guess members like you will always help beginners to understand the system, this is why a forum is the best place to learn.
I will update the topic with more information.
Thank you.
it is not just legacy and SegWit, it is also compressed and uncompressed public keys and also multi signatures both in SegWit outputs (2 types) and in legacy outputs (1 type). which depending on their number of signers the size can be very different. before the year ends we may even see new signatures (Schnorr) and end up with a new transaction size based on them!
it is good to learn but it is best to try and post things as a question.