Is there a formula of finding the minimum number of edges?
I know that for the maximum number of edges it is
$(n-k)(n-k+1)/2$ where $n$ is the number of vertices and $k$ is number of components.
I was reading online and some said $(n-1)(n-2)/2 +1$ however in my case I know there are $n=10$ vertices and $k=3$ components, hence the max number of edges is $28$.
If I apply the formula for min. found online I get $37$ edges which is clearly wrong.
To make a single component with $m$ vertices, you need $m-1$ edges. In your case, you need to have three components with $a,b,c$ vertices respectively, with $a+b+c=10$. It doesn't matter what you choose for $a,b,c$, in any case you need $$(a-1) + (b-1) + (c-1) = 10-3=7$$ edges to make such a graph.
So in general the formula is just $n-k$.