You are here:

Excel/Create an alert function



i have column A which has names of employes and column B has no. of hours. How do i add the hours if column A contains same employee more than 2 times?

Employee      Hours
Ali          4
Bryan          3
Ali          2
Ali          4
Bryan          5
Celine          5
Dangus          6
Bryan          1
Eloycious        7
Total          46

under the company, each employee must not work more than 20% of the total work hours (total 36 hours)

how do i make an alert using excel to indicate if any of the employees breach the 20% work hours limit

Im not sure how to write the formula
its something like =IF(   >20%*F23,"ALERT","OK")

Alert picture
Alert picture  
You sample formula shows you getting the total in F23 which doesn't match the sample data you show.  So I will tell you how to write a formula in column C assuming that Ali  4 appears the first time in A2:B2 and you data is in A2:B10.  I will just sum up the data in the formula since to get the total.    

C2:  =if(sumif($A$2:$A$10,$A2,$B$2:$B10)>20%*Sum($B$2:$B$10),"ALERT","OK")

Then drag fill this down the column C.

That alerted on all entries for Ali and Bryan.  

See the attached image.

Tom Ogilvy

About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts


Tom Ogilvy


Selected as an Excel MVP by Microsoft since 1999. Answering Excel questions in Allexperts since its inception in 2001. Able to answer questions on almost all aspects of Excel's internal capabilities. If seeking a VBA solution, please specify that in your question itself so I give you the answer you want. [Excel has weak protection - if you are distributing an application, I don't answer questions on how to protect your project from your users.]


Extensive experience.

Master of Science (MS) degree Operations Research (ORSA)

Awards and Honors
Microsoft MVP in Excel.

©2016 All rights reserved.