You will first need to define the nutrient levels and the fertilizer products (raw materials) you want to use in your formula. Knowing the concentration of nutrient (s) in each raw material then you can calculate your grade on a percentage basis.
Take an example:
Let us say you want the grade 19-19-19, (proportion 1:1:1), which means 19% N, 19% P2O5 and 19% K2O (i.e nitrogen, phosphorus, and Potassium, in that order); and you want to use for this formula the following products: DAP (Diammonium Phosphate, 18% N and 46% P2O5), Urea (46% N) and Potassium Chloride, KCl (60% K2O).
You can proceed as follows:
KCl: 19/0.60=31.7 Kg; DAP: 19/0.46=41.3 Kg; [DAP would also provide: 41.3 * 0.18=7.43 units % of N]. The amount of Urea would be: (19 - 7.43)/0.46=11.57/0.46=25.2 Kg Urea.
Total=31.7 + 41.3 + 25.2=98.2 Kg + (1.8 Kg filler or conditioner)=100 Kg. (to be on % basis).
Note: You may opt to produce your formula without filler and/or conditioner. In this case you can round up the numbers as: 32.5 + 42 + 25.5=100 and generate a little bit more nutrient on your grade. The actual (analytical formula) would read: 19.3-19.3-19.5 but guaranteed analysis is still 19-19-19.
Hope this will serve as an introduction to the subject.