Adjusting formula so it works even if some rows above empty?

  • Thread starter StargateFanFromWork
  • Start date
S

StargateFanFromWork

I have a dollar amount in cell F23, say, with a formula in G23 to deduct
that from subtotal in G22. The formula in G23 looks like this:
=IF($F23<>"",($G22-$F23),"")

This works great.

But I've run into a problem I need to adjust for and can't figure out.
These columns, F and G, from rows 18 to 31 are for miscellaneous
information. Sometimes I have amounts to deduct, other times it's just info
in the description column B to the left of F (there are some merged cells
there) about payments in the rest of the spreadsheet and no amount needs go
into column 23. So it's just a misc. section of the sheet.

But I added an amount in F28 for which the G28 is:
=IF($F28<>"",($G27-$F28),""), but which comes out blank since F24 to F27 are
empty. So a needed subtraction isn't made.

I'm guessing that my formulas in G must accommodate a "range" (do I have the
right term?) instead of actual absolute cells? Am I on the right track?
What is needed is to have any cell in column F subtracted from the running
subtotal of column G even if there are gaps in any of cells in F.
Can this be done?

TIA. :blush:D
 
B

Bernard Liengme

Numbers, text AND merged cells? Sounds like a dog's dinner.
Why not rationalize the worksheet?
best wishes
 
S

StargateFanFromWork

StargateFanFromWork said:
I have a dollar amount in cell F23, say, with a formula in G23 to deduct
that from subtotal in G22. The formula in G23 looks like this:
=IF($F23<>"",($G22-$F23),"")

This works great.

But I've run into a problem I need to adjust for and can't figure out.
These columns, F and G, from rows 18 to 31 are for miscellaneous
information. Sometimes I have amounts to deduct, other times it's just info
in the description column B to the left of F (there are some merged cells
there) about payments in the rest of the spreadsheet and no amount needs go
into column 23. So it's just a misc. section of the sheet.

But I added an amount in F28 for which the G28 is:
=IF($F28<>"",($G27-$F28),""), but which comes out blank since F24 to F27 are
empty. So a needed subtraction isn't made.

I'm guessing that my formulas in G must accommodate a "range" (do I have the
right term?) instead of actual absolute cells? Am I on the right track?
What is needed is to have any cell in column F subtracted from the running
subtotal of column G even if there are gaps in any of cells in F.
Can this be done?

TIA. :blush:D

Just reporting in that the Excel programming ng has a response to a msg that
I wrote related to this and looks like a solution will follow in that
thread. So pls disregard this thread.

Thank you!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top