It sounds natural, but it a dependent clause, not a sentence. You can say it, but if you write it, you need to add an exclamation mark:
"If you knew!"
"If you only knew!"
"If only!"
"If!"
No special structure is required for an exclamation - only enthusiasm.