+ Reply to Thread
Results 1 to 14 of 14

if condition for finding actual negative hours in my data

  1. #1
    Registered User
    Join Date
    03-05-2011
    Location
    India
    MS-Off Ver
    office 365
    Posts
    21

    if condition for finding actual negative hours in my data

    Hi All,

    I am using below formula for finding negative in my data

    Status=IF(AF507<0,"Negative","postive") and it finds correctly but see my data below
    if there is reversal like below where one entry has been reversed (same GUI, engagement and Transaction date), i want to show my status column as "blank" or "offset" instead of Negative and postive

    how do i modify my above formula to achieve that?


    GUI Engagement ID Transaction Date Hours Status
    16001294 E-65622690 4-Oct-20 -5 Negative
    16001294 E-65622690 4-Oct-20 5 postive
    16001294 E-65622690 5-Oct-20 -5 Negative
    16001294 E-65622690 5-Oct-20 5 postive
    16001294 E-41069102 6-Oct-20 5 postive
    16001294 E-65622690 6-Oct-20 -5 Negative

  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 2406
    Posts
    44,662

    Re: if condition for finding actual negative hours in my data

    Maybe this in F5, copied down:

    =IF(ISNUMBER(MATCH(1,(A4:A8=A3)*(B4:B8=B3)*(C4:C8=C3)*(D4:D8=-D3),0)),"Offset","")
    Attached Files Attached Files
    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

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

    Re: if condition for finding actual negative hours in my data

    You seem to be using an older version of Excel than me. So, please refer to the file (previous post). If the formulae are enclosed within a pair of { }, these are array formulae.

    These are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see the curly brackets { } appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...

  4. #4
    Registered User
    Join Date
    03-05-2011
    Location
    India
    MS-Off Ver
    office 365
    Posts
    21

    Re: if condition for finding actual negative hours in my data

    Hi Glenn,

    Its actually returning blank in my excel, see below screenshot, not sure what i am doing wrong

    Attachment 707899

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

    Re: if condition for finding actual negative hours in my data

    Did you open my file?
    Did it work there?
    Were there {} around the formula?

  6. #6
    Registered User
    Join Date
    03-05-2011
    Location
    India
    MS-Off Ver
    office 365
    Posts
    21

    Re: if condition for finding actual negative hours in my data

    Did you open my file?
    Yes i did open your file
    Did it work there?
    yes it did work there
    Were there {} around the formula?
    yes i can see that

    Its not working for me is it because i am using xlsm format? sorry about my Excel knowledge just a beginner

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

    Re: if condition for finding actual negative hours in my data

    No. .xlsm will make no difference.

    Did you set the formulae in YOUR sheet, using CTRL-SHIFT-ENTER as described in Post #3?

    If so, do you see the {} around the formula in YOUR sheet?

  8. #8
    Registered User
    Join Date
    03-05-2011
    Location
    India
    MS-Off Ver
    office 365
    Posts
    21

    Re: if condition for finding actual negative hours in my data

    Hi,

    yes, when i use Ctrl shift Enter and then press Enter, i can see curly brackets there, but when i change the ranges and column, the curly bracket goes automatically

    I changed the formula to below and curly bracket goes out, apparently my output comes as blank
    =IF(ISNUMBER(MATCH(1,(B7:B13843=B6)*(H7:H13843=H6)*(AA7:AA13843=AA6)*(AE7:AE13843=-AE6),0)),"Offset","")

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

    Re: if condition for finding actual negative hours in my data

    That's the way they work in older Excel versions. Go to the first cell with the formula. Adjust the ranges there. Enter using CTRL-SHIFT-ENTER. Check that the {} are there, drag the formula down the column.

  10. #10
    Registered User
    Join Date
    03-05-2011
    Location
    India
    MS-Off Ver
    office 365
    Posts
    21

    Re: if condition for finding actual negative hours in my data

    Unfortunately after many attempt, i am not able to bring the curly bracket
    is there any other formula i can use to get my result?

  11. #11
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,656

    Re: if condition for finding actual negative hours in my data

    Try alternative non-array formula:

    Please Login or Register  to view this content.
    If it does not meet requirement, try another

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Quang PT

  12. #12
    Registered User
    Join Date
    03-05-2011
    Location
    India
    MS-Off Ver
    office 365
    Posts
    21

    Re: if condition for finding actual negative hours in my data

    Hi,

    This does help

    however just a follow up question on this
    if i have to do this in power query, how will bring this logic?

    currently what i have is

    = Table.AddColumn(#"Changed Type with Locale1", "-/+", each if [Hours] < 0 then "Negative" else "Postive")

  13. #13
    Registered User
    Join Date
    03-05-2011
    Location
    India
    MS-Off Ver
    office 365
    Posts
    21

    Re: if condition for finding actual negative hours in my data

    Hi,

    how do i modify this formula so that i can use it in a table?
    i pasted the second option directly to my table and it actually didn't worked

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

    Re: if condition for finding actual negative hours in my data

    Please post a file with the table.

+ 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. Replies: 10
    Last Post: 07-18-2016, 09:51 AM
  2. [SOLVED] TextBox - Display hours greater than 24 and negative hours too.
    By gnaske in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-21-2014, 03:01 PM
  3. [SOLVED] More grief over Hours v TIME- Negative hours
    By wyndland in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-25-2013, 11:49 AM
  4. Replies: 1
    Last Post: 04-16-2013, 03:58 PM
  5. [SOLVED] Percentage of a Goal / Actual with Negative Numbers
    By Rwilliams_09 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-08-2013, 04:43 PM
  6. Calculating actual hours worked only in core hours
    By Val C in forum Excel General
    Replies: 3
    Last Post: 02-27-2013, 01:54 AM
  7. [SOLVED] how to add hours and show actual hours not decimal numbers
    By TWERNER in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 08-21-2006, 03:40 AM

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