|I guess I could use a little more clarity. Based on what you said, I can offer 2 suggestions but I don't if they will fit your needs.|
You can't have a number and a formula in a cell at the same time, so if the "number" in B2 will change, you would have to put it in another cell and then put a formula in B2 that references that cell as well as D2. In other words...
In A2 you might have 10.
In B2 you could put:
This would put 10 in B2 if D2 was empty and 13 in B2 if D2 wasn't empty. You could change the value in A2 to get different results.
If B2 should only ever be 10 or 13, you could put this in B2:
Going just a bit deeper, if you really need to check if D2 is a number or if it's 3 digits or a specific number, etc. that can also be done, but we'd need a little more info.
Hope that helps!