Highlight All Excel Records If Total Sales Exceed $1000 For Day - #347

If you like this content, please consider visiting the video on YouTube and subscribe to the MrExcel Channel to show your support!
This video has been published on Nov 18, 2009.
Andy "Cyber" Walker once asked me what seemed like a simple question - he wanted to use conditional formatting to change records to green if the total of all records for that day exceeded $1000. While this sounds simple, it actually is incredibly complex to set up. Episode 347 walks you through the amazing conditional formatting option to allow this to happen.

This blog is the video podcast companion to the book, Learn Excel from MrExcel. Download a new two minute video every workday to learn one of the 277 tips from the book!
maxresdefault.jpg


Transcript of the video:
Welcome back to the MrExcel podcast, I'm Bill Jelen.
I have an insanely hard problem today, and I have to blame it on Andy Walker.
When I was writing the book “Learn Excel from MrExcel”, I would often be taking trips up to Toronto, and be writing the book in the green room, and call for help.
And Andy walked up one day with what seemed like a really simple question, but as I try to explain it, you'll see that it's not as simple as you might think.
Andy had a list of sales with date here and a sales amount, and he wanted to highlight any day where the sales for the day were greater than 1000.
Well, that's kind of hard to do, because we have to add up multiple records to figure out whether those records add up to more than 1000.
The function that we use is a relatively new function called SUMIF, and SUMIF says “Take a look at all of the dates in column A.” I'm going to hit F4 to make that an absolute reference, and see if it's equal to today's date in column A, I'm going to freeze just A there, and if it is, then add up the corresponding number in column C. When I copy that down, you'll see that for each day, we'll see the total sales for the day, so on this particular day there were $611, on the next day $1189.
Now, Andy wanted to see any time that it was greater than 1000, so I'll put a little test here that says >1000, now instead of the actual number, I'm going to get either FALSEs or TRUEs.
Now, this whole formula was really just a temporary step to make sure that it was going to work.
I'm going to go to the formula bar, copy that formula using Ctrl+C, and then select my dataset, and go to Format, Conditional Formatting.
Now, in Conditional Formatting, most people don't know that you can change the Cell Value Is drop-down to be Formula Is, and then in the formula bar use Ctrl+V to paste the formula that you used, will click OK here.
And all of the days where the sales were >1000 turn green, absolutely amazing use for Conditional Formatting.
Don't try and build that formula in the Conditional Formatting dialog though, build a temporary column, make sure it's working, and then you can come back and delete the column.
There you have it, how to build a rather complex conditional formatting formula, that looks at several rows within your dataset, to decide whether or not to color this row.
Hey, thanks for stopping by, we'll see you tomorrow for hopefully a tip that is much simpler than this one!
 

Forum statistics

Threads
1,214,659
Messages
6,120,784
Members
448,992
Latest member
prabhuk279

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