+ Reply to Thread
Results 1 to 11 of 11

Please help with if then statement

  1. #1
    Registered User
    Join Date
    03-12-2013
    Location
    Green Bay, WI
    MS-Off Ver
    Excel 2007
    Posts
    5

    Please help with if then statement

    I would like to add a multi condition if then statement to my worksheet and I am missing the boat.
    I am calculating the full time equivalent of employees. So I enter the employment code and how many people fit that catagory per region and I want to put in an if/then that will tell me how many full time it equals...making any sense?

    part time professional = 1-50
    part time associate = 2-50
    a region has 40 employees so 20 "full time equivalents"

    there are several associates and professionals from 25%-100% employment...I am stuck

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,739

    Re: Please help with if then statement

    can we see an spreadsheet with examples and expected results

    i dont quite understand the example you have put in your post

    you have an employment code and number of people - mot sure how you decide what a FTE is

    a region has 40 employees so 20 "full time equivalents"
    not sure how you came to that calc

  3. #3
    Registered User
    Join Date
    03-12-2013
    Location
    Green Bay, WI
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Please help with if then statement

    Attached...thanks, I hope it helps

    If the employment code is 1-50 or 2-50 it is a part time employee and it will take two part timers to equal one full time equivalent so 40 2-50's would be 20 FTEs or if they same employees are employed at 25% (1-25 or 2-25) it would be 10 FTEs

    I want a function or macro that will show this caluclation in "I". What ever employment code is in C will be equal to the value in E*% of employment (25%, 50%, 100%). Can I do this for the whole worksheet?
    Attached Files Attached Files

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,739

    Re: Please help with if then statement

    I will look at spreadsheet in the meantime

    so the 2nd part of the code is the %

    assume row 2
    =IF(OR(C2="1-100",C2="2-100"),E2,IF(OR(C2="1-50",C2="2-50"),E2*0.5,IF(OR(C2="1-25",C2="2-25"),E2*0.25,"not a valid code")))

  5. #5
    Registered User
    Join Date
    03-12-2013
    Location
    Green Bay, WI
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Please help with if then statement

    Yes...second part of the code is the % worked. I wasn't sure how an OR/AND fit into the formula. I am a pretty basic girl this is a little out of my comfort zone

  6. #6
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,739

    Re: Please help with if then statement

    looked at the sheet

    How many codes are there -
    AC-1-100
    AC-1-25
    AC-1-50
    AC-2-100
    AC-2-25
    AC-2-50
    FP-1-100
    FP-2-100
    FP-2-25
    FP-2-50
    PM-0-0
    PM-1-0
    PM-2-0

    and can we assume that the last figure is the FTE % -does that work for all- what about PM codes ?

  7. #7
    Registered User
    Join Date
    03-12-2013
    Location
    Green Bay, WI
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Please help with if then statement

    the last figure is the % and the only codes I need to calculate are the AC codes

  8. #8
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,739

    Re: Please help with if then statement

    this should work

    =IF( MID(C2,1,2)="AC", VALUE(MID(C2,6,3))/100*E2, "what to put for Non AC codes")

    so
    I test the code in C2 to see if the first 2 characters are AC
    if they are
    than E2 is muliplied by
    i take the last 2or 3 characters from the text in c2
    I then use value to turn the text into a number
    then divide by 100 to make a %

    but if not AC code what do you want in the cell?

  9. #9
    Registered User
    Join Date
    03-12-2013
    Location
    Green Bay, WI
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Please help with if then statement

    if not an AC code it can be zero. I will wrap my brain around this and give it a go. I really appreicate the help

  10. #10
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,739

    Re: Please help with if then statement

    in which case
    =IF( MID(C2,1,2)="AC", VALUE(MID(C2,6,3))/100*E2, 0)

    see attached


    if you want the cell left blank
    =IF( MID(C2,1,2)="AC", VALUE(MID(C2,6,3))/100*E2, "")
    Attached Files Attached Files

  11. #11
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,739

    Re: Please help with if then statement

    the mid function is quite a useful way to manipulate text (theres others like left and right , but i tend to use the MID() )

    so MID ( the cell the text is in , the number of characters starting from the left , the number of characters after the starting point )

    so MID(C2,1,2 ) starts at the first character and counts 2 characters - and therefor extracts from your code AC or FP or PM

    and the other mid function

    starts at character 6 and extract three characters - so 100 or 50 or 25
    and then by using value - i change text to number

    actually - reading another post - it appears if you use the mathematical operators then text numbers will be treated as numbers - so no need to use value - great site , as I'm learning new stuff every day to
    Last edited by etaf; 03-12-2013 at 04:26 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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