+ Reply to Thread
Results 1 to 6 of 6

IF statements

  1. #1
    Registered User
    Join Date
    04-24-2014
    Location
    Dallas,Texas
    MS-Off Ver
    Excel 2003
    Posts
    20

    IF statements

    I posted this under another section but I think you could write an If function to do the same thing. I've been working on it and have progressed a little, but still cant hone it in.

    Good morning,

    I'm working on a safety database where I'm tracking work place injuries (see attachment). I'm taking the number of injuries that occur (in the injuries tab) and dividing by the number of employees (employees tab) to give me a percentage of employees injured for that specific area (percentage tab). What I'm looking for however, is a code that will automatically take those percentages and inputs the appropriate number on the first tab (risk assessment) according to the key listed at the bottom of the risk assessment tab. For example, if the ICU had 5% of its employees injured due to patient lifting on the percentage tab, I want the cell under patient lifting to automatically populate with a 2 in the risk assessment tab.

    Hope that is as clear as mud.

    As always, any help is greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,056

    Re: IF statements

    Where is the 5% for ICU/Patient lifting on the percentage Tab???? i can see 11.8%, not 5%....
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: IF statements

    I used this formula in Risk Assessment!B5 copied across and down.

    =IFERROR(IF(INDEX('Percentage per employee'!$B$5:$P$40, MATCH('Risk Assessment'!$A5,'Percentage per employee'!$A$5:$A$40,0),MATCH('Risk Assessment'!B$4, 'Percentage per employee'!$B$4:$P$4,0))> 0.1, 5,FLOOR(INDEX('Percentage per employee'!$B$5:$P$40, MATCH('Risk Assessment'!$A5,'Percentage per employee'!$A$5:$A$40,0),MATCH('Risk Assessment'!B$4, 'Percentage per employee'!$B$4:$P$4,0)), 0.02)*50),"N/A")

    Cells that had an error on "Percent by Emp" result in "N/A" here. Less, than 2% give 0, and so forth.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,056

    Re: IF statements

    If the rows & columns are ALWAYS in the same order, use this:
    =IFERROR(VLOOKUP('Percentage per employee'!B11,Sheet1!$A$1:$B$6,2,TRUE),"")


    If not, use this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    To get this to work, I created a LOOKUP table on a hideable sheet.... the version with the simpler formula is attached.
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 12-23-2015 at 02:38 PM. Reason: forgot one of the formulae...

  5. #5
    Registered User
    Join Date
    04-24-2014
    Location
    Dallas,Texas
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: IF statements

    and it worked! Thanks a lot! I never would have figured it out on my own.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,056

    Re: IF statements

    Thanks for the Rep. It's appreciated.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Formula with multiple IF statements and IF AND statements
    By lottidotti in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-14-2013, 08:03 AM
  2. Reading If statements and formulating values from if statements
    By crnam in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-16-2013, 05:20 AM
  3. questions with if statements and nested if statements
    By Pat Excel in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 02-03-2013, 01:41 PM
  4. Multiple nested IF statements and AND statements
    By TonyGetz in forum Excel General
    Replies: 2
    Last Post: 12-14-2010, 03:07 AM
  5. Nested If statements / logic statements
    By Brainless_09 in forum Excel General
    Replies: 3
    Last Post: 06-17-2009, 02:59 PM
  6. Replies: 12
    Last Post: 05-15-2009, 08:38 AM
  7. [SOLVED] operator statements, shorting when reusing one of the statements?
    By KR in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-04-2005, 02:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1