Purpler88, I tried sending you a message but could not. So here is my response:
I track the macros in my food and then use those values to get the calories.
Macros being fat, carbs, and protein. Fat is 9 calories per gram, [b]carbs 4 per gram (like you mentioned)[/b], and protein also 4 carbs per gram.
In 2017, I got the values I needed for different body weights using If It Fits Your Macros, a website (IIFYM).
Currently, I'm using a daily goal of 2210 calories broken down by macros :
90 g Fat (90*9 = 810)
180 g carbs (180*4 = 720)
170 g protein (170*4 = 680)
sum calories = 2210.
It's worked for me in the past. Your values from IIFYM will be different based on your age, height, current weight, and projected lean body mass (mine is 170 or 160 pounds). Also, as they say, your mileage may vary.
Hope this answers your question!