Allow user to edit formula

thart21

Board Regular
Joined
Mar 3, 2005
Messages
159
Don't know if this is possible but I have a formula to calculate a date and need to allow the user to change it when needed. Was thinking of an input box or even a dedicated cell that they could do this in and have it replace that part of the formula that needs to be changed.

=SUM(SUMIFS('PGI Data'!$G:$G,'PGI Data'!$A:$A,$P1,'PGI Data'!$M:$M,$L1,'PGI Data'!$C:$C,"<="&DATE(YEAR($M1),MONTH($M1)+1,-6),'PGI Data'!$N:$N,C10,'PGI Data'!$B:$B,"Z002"))

I want the user to have the ability to change the "-6" in the "DATE" part of this formula to whatever they need it to be. This calculates the last day of the month in Column M minus 6 days. Sometimes it may need to be -4 or -5 or anyother number (not more than 7)

Any way to do this one? Thanks for any help!

Toni
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Validate the value your user enters, save it in a cell like Z99 or somesuch and then use the cell reference in your formula:-
Code:
=SUM(SUMIFS('PGI Data'!$G:$G,'PGI Data'!$A:$A,$P1,'PGI Data'!$M:$M,$L1,'PGI Data'!$C:$C,"<="&DATE(YEAR($M1),MONTH($M1)+1,[COLOR=red][B]Z99[/B][/COLOR]),'PGI Data'!$N:$N,C10,'PGI Data'!$B:$B,"Z002"))
Don't let your user anywhere near your formulae!
 
Upvote 0
Is it that you always want, like, the last Friday of the month or something? Because you can calculate that fairly easily and incorporate it into a formula without any user input.
 
Upvote 0
Thanks for the response Ruddles, I will try that out. The standard that they want is the end of the month -6 but, if there is a holiday or another factor, they need the ability to adjust it.

Thanks again!

Toni
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,289
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