If then-formula

Bryant Rob

New Member
Joined
Aug 16, 2018
Messages
4
Hi Everyone, first post here. I couldn't find anything on it. I want to have a running total of two columns showing in a third column, which I was able to do with the following that I found in another post:

=SUBTOTAL(109,$D$3:D9, $E$3:E9)

my problem is that after my last row with data, it keeps posting the same amount all the way down. I wanted to have those cells remain blank if there is no data in my first column, but use the formula to calculate the running total if there is data. I tried the following:

=IF(A21="","","=SUBTOTAL(109,$D$3:D21, $E$3:E21)")

this works fine if A21 is blank, but when I put data, it just shows the actual formula in my subtotal column instead of calculating.

I hope I explained it clear enough.

As of now, all I can figure to do is leave the total column blank until I add data, then copy the formula down to where I am up to.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Dunno if this solves your problem or not

=IF(A21="","",SUBTOTAL(109,$D$3:D21, $E$3:E21))


That does it! I had a friend come back with the same exact solution at the same exact time as you, lol. I tried this, but my problem was leaving a "=" in before SUBTOTAL.

Thank you!
 
Upvote 0
The problem was actually the quotes, whatever you put in quotes is assumed to be text.
 
Upvote 0
Actually, the first thing I tried was taking out the quotes, but I had an equals sign in front of SUBTOTAL which gave me an error. I am new to conditional formatting and didn't know you only use one = at the beginning.
 
Upvote 0
Your description of this problem is not conditional formatting.

Conditional formatting formats a cell (it does not change values) based on a specified condition.
In conditional formatting you specify the formula where the condition is TRUE, e.g. I have a list of days and I want to highlight every Friday
With a column selected the condtional formula needed would be

=(A$1="Friday)

the condtion where the formula is TRUE.
The formula is adjusted automatically as the column is selected.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,159
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top