make formula "dynamic"

ndendrinos

Well-known Member
Joined
Jan 17, 2003
Messages
1,694
Code:
=IF(ISERROR(sumgrey($H$17:$H$35)*G37),"",sumgrey($H$17:$H$35)*G37)

Hello : Instead of range H17:H35 can the formula work as cells are filled within that same range?
The reason I need to do this is because the formula shown above does not work if there are blank cells within that range
If I fill the blank cells with zeros then the formula works but that interferes with further code so the unused cells must remain "blank"

Many thanks
 
Last edited:

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.
Code:
=IF(ISERROR(sumgrey($H$17:$H$35)*G37),"",sumgrey($H$17:$H$35)*G37)

Hello : Instead of range H17:H35 can the formula work as cells are filled within that same range?
The reason I need to do this is because the formula shown above does not work if there are blank cells within that range
If I fill the blank cells with zeros then the formula works but that interferes with further code so the unused cells must remain "blank"

Many thanks
What type of data is entered in the cells?

sumgrey sounds like a UDF that sums the values of cells that have been formatted with a grey color.

Is the data entered as a contiguous block?
 
Upvote 0
hello T.Valco
Answer to your questions 2&3 is yes

As for the first question nothing is entered in range H17:H35
the formula in those cells is (example for G21)
=IF(OR(G21="",$G$36=""),"",((G21)*(-$G$36))-(-G21))

G36 is a discount percentage (i.e.5%)

G37&G38 contain the formula Krishnakumar supplied here
G37 is one type of tax G38 is another

Some items are taxable (the ones in "grey") while some are not (these are left "Automatic")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,291
Members
452,902
Latest member
Knuddeluff

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