Math Question

Oorang

Well-known Member
Joined
Mar 4, 2005
Messages
2,071
This may be the dumbest question ever but I can't remember how to do this and all the sites that cover exponentiation do not speak to it. How do you solve for X in the following? I mean I could just put up a loop that would count how many times 2187will divide by 3, but I thought there was a better way.
3^X = 2187
 
Final(?) code looks like this:
Code:
'Convert bytWeeks into a day of the week and store it for further use.
'Verify 1 (and only 1) day is selected. Make sure that one selected day is
'equal to the weekday of dtEval. First argument is for speed as the vast 
'majority of items will be 0. Last argument prevents Switch returning a
'null value and causing an error.

bytWeekday = VBA.Switch(bytWeek = 0, 0, bytWeek = 64, 1, bytWeek = 32, 2, bytWeek = 16, 3, bytWeek = 8, 4, bytWeek = 4, 5, bytWeek = 2, 6, bytWeek = 1, 7, bytWeek > 0, 0)

'If bytWeekday = 0, then no weekdays (or multiple weekdays) were selected.

If Not bytWeekday = 0 Then Err.Raise 513, "IsScheduledMonthly", "Illegal argument in bytWeekday"
blnIsWday = (VBA.Weekday(dtEval, vbSunday) = bytWeekday)
 
Upvote 0

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Forum statistics

Threads
1,225,229
Messages
6,183,729
Members
453,185
Latest member
radiantclassy

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