Advanced Math Calculations Using Spotlight

You can do more than just basic calculations with Spotlight on a Mac. You can use parenthesis, exponents, trig functions, include units and much more.
You can also watch this video at YouTube.
Watch more videos about related subjects: Spotlight (11 videos).

Video Transcript

Hi, this is Gary with MacMost.com. Let's go beyond the basics and look at some of the advanced math that you can do in Spotlight.
MacMost is brought to you thanks to a great group of more than 1000 supporters. Go to MacMost.com/patreon. There you can read more about it. Join us and get exclusive content and course discounts.
So you probably already know that you can use Spotlight on your Mac to do math. Just use Command Space to bring up the Spotlight Search Menu. Then type a math equation. So, for instance, you can type a simple equation like this and you can get the answer. But you can go far beyond this.
First, you can of course use all four major operators. So you could use a dash, use an asterisk for multiplication, and use a slash for division. Then, of course, you can use these in combination. So, for instance, you can do something like this and you'll get a result. Notice that it follows standard rules for operation precedence. So multiplication is done first. 3*5 is 15. Then the addition is done. It does not do 2+3 first and then multiply by 5. This gives it a little bit of an advantage over using the standard Calculator App or a hand-held calculator. But you can go beyond this and actually use parentheses. So, for instance, you can do something like this and then in parentheses put a portion of your calculation and you can see how it will obey that. You can go many levels deep with parentheses like this to make sure it is doing exactly the calculation that you want. If you do a lot of math you may know that sometimes multiplication is implied. For instance, if I were to do this on paper it is implied that it is multiplication between 5 and what is in the parentheses. You can see Spotlight works that way too.
Now let's say you want to do powers. So you want to do 5 squared. You can use the carat symbol which on US keyboards is Shift 6 and then put your exponent there. You can square something or cube it or put any exponent like that.
You can also use the percent symbol. So, for instance, you can type a number like this and then multiply it by, of course, .2 to find out 20% of that number. You could also just type 20 and then the percent symbol and it will convert this part here, 20% .2 before doing the calculation. But the percent symbol is also used for modulus which gives you the remainder of division. So, for instance, if I were to put 17 and then % that is 17%. But if I were to put another number after it, like 10, then it is going to assume I mean 17 mod 10 so it is going to give me the remainder, 7, after division by 10.
You can use logarithms as well. So you can type log like that or ln for the natural log. You can also do the standard exp function as well which is the same as if you take constant e, which is understood here as long as you include it as part of a calculation, and then you do, to the power of 2, and you can see you get the same result. 
If you ever want to see e by itself, typing e won't get you there. But multiplying by 1 will.
You also have got special quick functions for square root, like this or cube root, like this. But, of course, you can always just use an exponent and then division inside of parentheses like that to get any root you want. 
You've got factorial as well. So 2 factorial (2!) or 7! just put the exclamation point after it. 
You can also do trigonometry. So, for instance, like this and just put a number in there. Now it is using those numbers as radians and you can use cosine cos, you can use tangent tan, you can also put an a in front of any of those for, say, arctangent and you can put an h after it for hyperbolic. You have a constant pi you can use. So you can say sine of pi divided by 2. Just type the letters p and i like that. If you ever want to get pi by itself it doesn't work if you just type pi. Just like with e you can multiply by 1 and then see the results.
You can also use degrees but there are two ways to do that. One is to put the letter d after the function and then use degrees. So like, say, 45d. But another way to do it is to type 45 and then deg after it like that.
You have some rounding functions as well. So if you type ceil and you type a number like this it will round upwards. If you change that to floor it will always round down. If you want it to round to the nearest integer use rint, like that. You also have abs for absolute value. So it will take it to a negative number and make it positive.
You also have the standard error function. If you want to know what that is you can checkout the wikipedia page for it.
Now you may also know you can do unit conversions in Spotlight. You can combine those with calculations. So you can do something like this. You can say 3 cups and it is going to tell you it is 1.5 pints or you can say in liters. You can also do calculations there. So after 3 cups I can say multiply by 3 and you can say I'm going to need the results in liters but it is going to give me the results as if this way 9 cups. You can combine units too in ways that make sense. So, for instance, you can put 50 mph for miles per hour and multiply that by 2 hours. You can see you get the result in miles. Which makes sense. You can do it with currency conversion as well. So, for instance, I can type 25 euros and it is going to give me the current value in dollars. You can multiply that by 2 and it will stay in euros because it assumes I'm doing just a calculation here. But I can still do a conversion. Say in usd gives me the result in dollars.
Now the last thing I want to show you is probably the most useful of all. That's what you can do when you're done with a calculation. So say you do something like this and you get your results. What do you do with it now? Well, you could just type the result wherever you need it. But you could also, at this point, just do Command C to Copy. It copies the result. Now I can go into another app and do Command V to Paste and I get the result right there. Of course at this point I also have to do a little call out to my own free Clip Tools App. If you've gotten that from the App Store you can select something like this in text and one of the things that Clip Tools does is allow you to calculate the selection and then it pastes the result right there with or without the original formula. So if that is something you do a lot you definitely want to checkout Clip Tools in the App Store.
I hope you found these Spotlight math tips useful. Thanks for watching.

Comments: 12 Comments

    Bob
    2 years ago

    Curious... do you know of a way to do quick ∆% calculations with either the Mac baked in calculator, spotlight Siri etc?

    Thats something I'd use multiple times a day.

    Excellent videos... Thanks Gary!

    2 years ago

    Bob: You'll need to describe what you want more than that. Give me an example.

    Dan Parton
    2 years ago

    On my M1 24" Mac, when I follow the formula you give for tan(45), it comes up with tan(45) = 1.619775... The answer should be 1. What's wrong?

    2 years ago

    Dan: If you just give it a number, it will assume radians. See the video. Use tan(45deg) or tand(45)

    Sheldon
    2 years ago

    Thanks bunches

    Sheldon
    2 years ago

    Please excuse my dear aunt Sally PEMDAS thanks for noting operation sequence

    Bob
    2 years ago

    Hi Gary... ∆%, (or %CH) as often found on HP calculators. Say something was $69.99 yesterday & $49.99 today, it's a 28.58% reduction. It's easy enough to calculate manually, but if a Mac calculator/spotlight/Siri shortcut exists it would be nice; I do those calculations multiple times a day. Thanks!

    Dan Parton
    2 years ago

    Thanks, Gary. The "If you just give it a number, it will assume radians. See the video. Use tan(45deg) or tand(45)" works correctly. Something to note, the calculator in the M1 doesn't need the "deg" designation. Formula is "45, click tan, = 1" Interesting to say the least.

    2 years ago

    Bob: So just (69.99-49.99)/69.99 gives you that result. I don't think there is an easier way.

    2 years ago

    Dan: The Mac Calculator app, in Scientific mode, has a Deg/Rad button at the bottom left corner. So if you switch to degrees (in which case the button shows "Rad") then works that way, yes.

    Ken Nellis
    2 years ago

    Good things to know. Thanx! Playing along with your video, discovered after entering a calculation in Spotlight, if I hit Return, it launches Calculator with the answer in it. Not sure how useful that is, but kinda neat.

    Jerry
    2 years ago

    Really helpful. Looks like a lot of these cool tricks are available, for what it's worth, using Spotlight on the iPhone, too.

Comments are closed for this post.