create a formula using shared variables. something like:
shared stringvar add;
shared stringvar workAdd;
if {table.field}="work" then (
workAdd := {table.fieldAdd}
)
else(
add := {table.fieldAdd};
);
you would repeat for all variables. this would go in the detail section. You might want to reset the values to "" in the group header for, in case something is NULL in the database.
finally, in the group footer, you would call several formula (one for each field) to display your home/work addresses, something like:
shared stringvar add
HTH