I have been able to dynamically create the format part, but don't know how I can dynamically create the variables part.
The format is not a String. Why on earth are you pissing away resources using a String?
char *format = "%s,$s,%1.1f";
sprintf(foo, format, stringvar1, stringvar2, floatvar1);
The last part of your statement makes no sense. When you call sprintf, you must tell it which variables to use AT THAT POINT IN TIME.