Hello
R = U / I
U = R * I
I = U / R
R-resistance in ohms
I is the amperage in A
U-voltage in volts
So, if you have a 12V battery, your led needs about 0.01-0.02A amps,
the power supply is subtracted from the voltage of the proper operation for the diode:
12V (supply voltage) -2.4V (diode voltage for the yellow diode) = 9.6V
Now for the formula:
R = U / I
R = 9.6V / 0.02A
R = 480om
The discrepancy is because you were probably calculated for the current of 0.01A, I usually do the average of 0.015A or it was calculated for a different diode voltage (different color

)
For a series connection, the diode voltages add up, and for a parallel connection, you add up the currents.
You can find the tensions for a given color in my post
https://www.elektroda.pl/rtvforum/topic671136.html Third topic from the end :)
If you have any other questions, I will be happy to answer