+ Reply to Thread
Results 1 to 35 of 35

What is the right IF function to use to sum the last above cell has value and ignore zero?

  1. #1
    Forum Contributor MGadAllah's Avatar
    Join Date
    04-13-2008
    Location
    Sheet1
    MS-Off Ver
    365,2307,16.0.16626.20170,64bit
    Posts
    190

    What is the right IF function to use to sum the last above cell has value and ignore zero?

    Hi,
    I need a hand to sort this formula the right way.
    I am working with a call center workbook for daily agents performance and number of calls.
    Call center system generates only cumulative data.
    For example:-
    1st day=50 , which means net calls = 50 as it is the 1st day and no other previous any calls.
    2nd day=80 , which means net calls = 80-50= 30 net calls.
    So I set a formula to calculate today cumulative calls volume minus yesterday cumulative calls volume as shown above.
    My problem arise in case there is any day off for any agent.
    This is current reads of the system and net calls calculated manually
    success net
    1st day 15 15 (1st day and no other previous any calls)
    2nd day 28 13 (cumulative today success calls as read from the system =28) - (cumulative yesterday success calls as read from the system =15) = 13 (net calls)
    3rd day 42 14 same
    4th day 55 13 same
    5th day 0 0 Agent is off
    6th day 0 0 Agent is off
    7th day 0 0 Agent is off
    8th day 80 25 This is 80-55 which represent today calls - the last working day before the vacation of the agent which is 55, so 80-55=25 net calls.
    This is my problem, what is the right formula function to use to calculate the net calls correctly and take agent vacation in consideration?

    9th day 99 19 same
    10th day 114 15 same
    11th day 128 14 same
    12th day 156 28 same

    This is the excel sheet for this values to tell me the right thing.
    NetCallsFormula.xls
    https://www.dropbox.com/s/3ou1axh904...llsFormula.xls

    So please what is the right formula to calculate the net calls and take this vacation into consideration?

    Thanks
    Last edited by MGadAllah; 07-14-2014 at 12:46 PM.

  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,023

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Hi Mohamed. I think that this is what you need. Paste this into C2 and copy down.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    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 Contributor MGadAllah's Avatar
    Join Date
    04-13-2008
    Location
    Sheet1
    MS-Off Ver
    365,2307,16.0.16626.20170,64bit
    Posts
    190

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Quote Originally Posted by Glenn Kennedy View Post
    Hi Mohamed. I think that this is what you need. Paste this into C2 and copy down.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    I pasted it but it results nothing, does it miss any ; or , or ( )

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Some people can't access dropbox.

    You can attach the file here

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  5. #5
    Forum Contributor MGadAllah's Avatar
    Join Date
    04-13-2008
    Location
    Sheet1
    MS-Off Ver
    365,2307,16.0.16626.20170,64bit
    Posts
    190

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Quote Originally Posted by Jonmo1 View Post
    Some people can't access dropbox.

    You can attach the file here

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Attachment added to 1st post.
    Attachment 332017

  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,023

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Hi. Formula as stated above, pasted into your sheet.
    Attached Files Attached Files

  7. #7
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Try this in C3 filled down

    =IF(B3=0,0,B3-LOOKUP(2,(1/B$2:B2),B$2:B2))

  8. #8
    Forum Contributor MGadAllah's Avatar
    Join Date
    04-13-2008
    Location
    Sheet1
    MS-Off Ver
    365,2307,16.0.16626.20170,64bit
    Posts
    190

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Quote Originally Posted by Jonmo1 View Post
    Try this in C3 filled down

    =IF(B3=0,0,B3-LOOKUP(2,(1/B$2:B2),B$2:B2))
    But the problem is that I do not exactly the cell that will have a value = 0.
    I mean there is 366 in a year. and each day has a value and this value could be a zero in case the agent was off or could be equal to a value like 20 or 34 ...etc in case there is a cumulative calls.
    So as you can see I need to calculate the net calls for today and the last day that has a value.
    Ignore the zero and only add the last value before the zero.
    Thanks

  9. #9
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Did you try it?

  10. #10
    Forum Contributor MGadAllah's Avatar
    Join Date
    04-13-2008
    Location
    Sheet1
    MS-Off Ver
    365,2307,16.0.16626.20170,64bit
    Posts
    190

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Quote Originally Posted by Jonmo1 View Post
    Did you try it?
    It gives me an error that it is not correct
    Untitled.png
    \1

  11. #11
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    You probably need to change the commas to semicolons (, to ; )

    =IF(B3=0;0;B3-LOOKUP(2;(1/B$2:B2);B$2:B2))

  12. #12
    Forum Contributor MGadAllah's Avatar
    Join Date
    04-13-2008
    Location
    Sheet1
    MS-Off Ver
    365,2307,16.0.16626.20170,64bit
    Posts
    190

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Quote Originally Posted by Jonmo1 View Post
    You probably need to change the commas to semicolons (, to ; )

    =IF(B3=0;0;B3-LOOKUP(2;(1/B$2:B2);B$2:B2))
    Yes this is working well.
    Thanks a lot, but please I will test it more with full data and feed you back.
    Thanks

  13. #13
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Glad to help

    But looking back, I think Glenn's formula is better from Post #2. (you need to change the , to ; in that formula as well)

  14. #14
    Forum Contributor MGadAllah's Avatar
    Join Date
    04-13-2008
    Location
    Sheet1
    MS-Off Ver
    365,2307,16.0.16626.20170,64bit
    Posts
    190

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Quote Originally Posted by Jonmo1 View Post
    Glad to help

    But looking back, I think Glenn's formula is better from Post #2. (you need to change the , to ; in that formula as well)
    I know this may sound silly but because i am still learning and trying to understand may you please explain the meaning of this formula?
    I mean yours and Glenn.
    Thanks

  15. #15
    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,023

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Mine's very simple. Take row 4 as an example.

    If B4 is 0, put 0 (the days off...). Otherwise put B4 (the cumulative sum of calls logged: 42) minus the sum of cells C1 to c3 (0+15+13=28), giving a final result of 14 (the total number of calls logged minus the number on each of the previous days combined).

    Did you try my formula and did it work OK, giving you your expected answer?

  16. #16
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Quote Originally Posted by Glenn Kennedy View Post
    Did you try my formula and did it work OK, giving you your expected answer?
    It did for me, and so much simpler than mine

    I'm not even going to bother to explain mine given there is a far simpler solution already provided.

  17. #17
    Forum Contributor MGadAllah's Avatar
    Join Date
    04-13-2008
    Location
    Sheet1
    MS-Off Ver
    365,2307,16.0.16626.20170,64bit
    Posts
    190

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    I am afraid that it is not the way I looking for and I am sorry I was not able to explain it the right way from the beginning.
    Here is a file to explain it the right way and I do hope that I was able to explain it correctly so please check this file and tell me the right formula.
    Given that I do not know when will be the day off for the agent so it could be one day or two or three days but all will be continuously meaning it will be Friday and Saturday or Friday and Saturday and Sunday ...etc
    NetCallsFormula.xls

  18. #18
    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,023

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    My formula is EXACTLY the same as it was in Post 2. It gives the answer that you want. Can you please explain WHY it is not what you want????
    Attached Files Attached Files

  19. #19
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Copy Glenn's formula directly from Post #2.
    Paste it into C2 and fill down.

  20. #20
    Forum Contributor MGadAllah's Avatar
    Join Date
    04-13-2008
    Location
    Sheet1
    MS-Off Ver
    365,2307,16.0.16626.20170,64bit
    Posts
    190

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Quote Originally Posted by Glenn Kennedy View Post
    My formula is EXACTLY the same as it was in Post 2. It gives the answer that you want. Can you please explain WHY it is not what you want????
    YES, this one in the sheet =IF(B2=0;0;B2-SUM(E$1:E1)) working great.

    But only one problem, if I want to add a column title what would be the range? I mean for part E in the equation?

    Also if I want to determine some exact range in column E and not the full one, what would the case?

    Finally may you explain it as I am truly do not understand it. What I understand as follow:-
    If B2=0 ; then place 0 in the cell.
    If B2 does not = 0 ; then result of this equation (B2 - SUM(E$1:E1)).
    Did I get it correctly?
    If I get it correctly, then what is the use of the SUM(E$1:E1) ?

    Thanks

  21. #21
    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,023

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Add a title in column E and see what happens: nothing. It still works (unless the title is a number, in which case the row 2 doesn't work properly.

    If B2=0 ; then place 0 in the cell.
    If B2 does not = 0 ; then result of this equation (B2 - SUM(E$1:E1)).

    YES.

    what is the use of the SUM(E$1:E1) ?

    It adds up the number of calls in each individual day (E$1:E1) BEFORE TODAY. You subtract that from the total number of calls INLCUDING TODAY to get the number of today's calls.

  22. #22
    Forum Contributor MGadAllah's Avatar
    Join Date
    04-13-2008
    Location
    Sheet1
    MS-Off Ver
    365,2307,16.0.16626.20170,64bit
    Posts
    190

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Quote Originally Posted by Glenn Kennedy View Post
    Add a title in column E and see what happens: nothing. It still works (unless the title is a number, in which case the row 2 doesn't work properly.
    Yes it is working and I must did something wrong last time.

    Quote Originally Posted by Glenn Kennedy View Post
    If B2=0 ; then place 0 in the cell.
    If B2 does not = 0 ; then result of this equation (B2 - SUM(E$1:E1)).

    YES.
    Thanks for clearing this.

    Quote Originally Posted by Glenn Kennedy View Post
    what is the use of the SUM(E$1:E1) ?

    It adds up the number of calls in each individual day (E$1:E1) BEFORE TODAY. You subtract that from the total number of calls INLCUDING TODAY to get the number of today's calls.
    You are good with the math lol.

    One last thing, let's suppose what we did was a range for the 1st agent which has the range e2 to e367 because e1 has the title (366 rows).
    and I want to add another range for another agent that has 366 rows as well from e368 to e732 and this range dedicated to the 2nd agent only while the 1st range was dedicated to 1st agent only, in that case what would be the formula for the 2nd range for the 2nd agent because this time I won't need to calculate from the beginning of the sheet @ e2 but will need to start from e367.

    I hope that I cleared it enough

    Thanks

  23. #23
    Forum Contributor MGadAllah's Avatar
    Join Date
    04-13-2008
    Location
    Sheet1
    MS-Off Ver
    365,2307,16.0.16626.20170,64bit
    Posts
    190

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    gentle reminder please.

  24. #24
    Forum Contributor MGadAllah's Avatar
    Join Date
    04-13-2008
    Location
    Sheet1
    MS-Off Ver
    365,2307,16.0.16626.20170,64bit
    Posts
    190

    Re: What is the right IF function to use to sum the last above cell has value and ignore 0

    I am sorry for pushing or hurry things up but I am quite have few hours before I should apply this model and do need to know how to adjust the formula.
    Thanks

    This equation :-
    =IF(B2=0,0,B2-SUM(C$1:C1))
    How to let it start from C367 as mentioned in my above mentioned reply?

  25. #25
    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,023

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Try this.

    You have a slight problem, then, as the equation needs to have a non-numerical cell to start in. I would normally say that you should use:
    =IF(B368=0,0,B2-SUM(C$366:C366)). Is there a possibility to leave a one-row gap between the agents? Is the row of header information repeated again? If so, on which row?

  26. #26
    Forum Contributor MGadAllah's Avatar
    Join Date
    04-13-2008
    Location
    Sheet1
    MS-Off Ver
    365,2307,16.0.16626.20170,64bit
    Posts
    190

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Quote Originally Posted by Glenn Kennedy View Post
    Try this.

    You have a slight problem, then, as the equation needs to have a non-numerical cell to start in. I would normally say that you should use:
    =IF(B368=0,0,B2-SUM(C$366:C366)). Is there a possibility to leave a one-row gap between the agents? Is the row of header information repeated again? If so, on which row?
    Each agents has a range of 366 cells which is the number of days of a whole year.
    And as you can see in the attached document that agents are sorted one after or above each others ...etc
    Because I do not know when the agent will have a day off or when the agent start a survey, I made the whole year according to the equation shown in the attached document.
    And I will enter the success number manually as generated from the system, but will need to apply a formula to the net success
    So please take a look and tell me.
    But to answer your question, it is repeating after 366 rows (which represent maximum number of any given years) ... etc and so on
    I was thinking about if I may add the cell that contains the name of the agent to the equation, I mean to make it look for the agent name and see if it is the same as the agent name in the above cell or not and if it is the same then formula you applied will apply otherwise if agent name is not the same as the name in the above cell then the formula will start to count from this point and so on.
    I do not if my idea is applicable or not in excel but just think about it.
    Book1.xlsx

  27. #27
    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,023

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Why not simply reorganise your data?
    Attached Files Attached Files

  28. #28
    Forum Contributor MGadAllah's Avatar
    Join Date
    04-13-2008
    Location
    Sheet1
    MS-Off Ver
    365,2307,16.0.16626.20170,64bit
    Posts
    190

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Quote Originally Posted by Glenn Kennedy View Post
    Why not simply re organise your data?
    Because I will use pivot table later on to view this data in a report format.
    This is the real file to let see the big picture.
    https://www.dropbox.com/s/9nwv8reh8qlo4lh/Book111.xlsx

  29. #29
    Forum Contributor MGadAllah's Avatar
    Join Date
    04-13-2008
    Location
    Sheet1
    MS-Off Ver
    365,2307,16.0.16626.20170,64bit
    Posts
    190

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Book111_[15-07-2014]_[09-01-31].zip
    This is the same file in case you can not access the drop box.
    Thanks

  30. #30
    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,023

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Try this out. I have had to add a helper column. Please note the deliberate inclusion of an empty row between the headers & the first row of data. How does this work for you?
    Attached Files Attached Files

  31. #31
    Forum Contributor MGadAllah's Avatar
    Join Date
    04-13-2008
    Location
    Sheet1
    MS-Off Ver
    365,2307,16.0.16626.20170,64bit
    Posts
    190

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Quote Originally Posted by Glenn Kennedy View Post
    Try this out. I have had to add a helper column. Please note the deliberate inclusion of an empty row between the headers & the first row of data. How does this work for you?
    Does adding an empty row will not hard the pivot table result?
    If it will not harm the result, then which formula you think is more suitable?
    Thanks

  32. #32
    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,023

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Try it out yourself & let me know...

  33. #33
    Forum Contributor MGadAllah's Avatar
    Join Date
    04-13-2008
    Location
    Sheet1
    MS-Off Ver
    365,2307,16.0.16626.20170,64bit
    Posts
    190

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    Quote Originally Posted by Glenn Kennedy View Post
    Try it out yourself & let me know...
    Thanks a lot and I owe you a lot.

  34. #34
    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,023

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    I had a very quick look at setting up a pivot table and it seems OK. but try it on your main sheet.

  35. #35
    Forum Contributor MGadAllah's Avatar
    Join Date
    04-13-2008
    Location
    Sheet1
    MS-Off Ver
    365,2307,16.0.16626.20170,64bit
    Posts
    190

    Re: What is the right IF function to use to sum the last above cell has value and ignore z

    ok, really much 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. Using the "DAYS360" function-ignore blank cell
    By wvpersephone13 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-17-2014, 12:54 AM
  2. [SOLVED] In an IF function, How to ignore “[Value_if_false]” function when value is true
    By jason444 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-11-2013, 12:14 AM
  3. Ignore zero in min function
    By nigelog in forum Excel General
    Replies: 2
    Last Post: 12-10-2009, 10:57 AM
  4. [SOLVED] Function to ignore decimals
    By Poliisi in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 09:05 PM
  5. Function to ignore decimals
    By Poliisi in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 07: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