+ Reply to Thread
Results 1 to 2 of 2

Assign values based on conditions in excel

  1. #1
    Registered User
    Join Date
    09-15-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    1

    Assign values based on conditions in excel

    I have values in rows which am going to use to calculate efforts as given below:

    day1 day2 day3 day4 day5

    7 L 7 7 7
    7 7 L L 7
    L L 7 7 7

    (L=Leave)

    While calculating the sum for the above rows i want to assign L= -7 and get sum. Can any one suggest easy way to do this?

  2. #2
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Assign values based on conditions in excel

    Hello

    for all the table above something like

    =SUM(A1:E3,COUNTIF(A1:E3,"L")*-7)

    or row by row

    =SUM(A1:E1,COUNTIF(A1:E1,"L")*-7) then fill down

    the logic is to sum the numbers 7 -->sum(A1:E1,
    then count the number of letter L then multiply by negative 7 COUNTIF(A1:E3,"L")*-7

    Hth.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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