I don't know where you got "F= ag" but, normally, "a" is acceleration and "g" is "acceleration due to gravity. And then in you calculation below, you replace "a" with the initial speed. It certainly is NOT true that "speed times acceleration due to gravity " is equal to any common physics quantity.
In any case, there is no reason to worry about "F", force, at all. What is important is that the acceleration is -9.8 m/s^2. So the acceleration. after t seconds is -9.8t+ 37 m/s and the height reached, above the initial position, after t seconds is -4.9t^2+ 37t m. Set that equal to 47 m, solve for t, then find the velocity at that t.