+ Reply to Thread
Results 1 to 10 of 10

Assistane with IF array formula needed

  1. #1
    Registered User
    Join Date
    08-08-2019
    Location
    UK
    MS-Off Ver
    Unknown
    Posts
    4

    Unhappy Assistane with IF array formula needed

    I would like to be able to auto-populate a column with a time value depending on the value in another.

    For example, Column H runs a total of hours worked... 8:30, 4:00, 9:00 etc and I would like column I to autocalculate to remove 30 mins if that number is over 6 hours.

    I have:
    =arrayformula(if(H2:H<6/24,H2:H,H2:H-1/48))


    But this just gives me #NAME?

  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
    43,893

    Re: Assistane with IF array formula needed

    Eh?? Is this an Excel question?

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? However, please give us an indication of the approximate number of rows of data you want the solution to work with (100, 1000, 100,000 or whatever). Please don't attach a picture of an Excel sheet (no-one will want to re-type all your stuff before starting).

    1. It does NOT have to be your real sheet - mock up a SAMPLE if you need to. But not 1000's of rows!!! It makes manual checking so tedious. Whatever you do... make sure that all confidential information is removed first!!

    2. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    3. Make sure that your desired solution is also shown (mock up the results manually).

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    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
    Registered User
    Join Date
    08-08-2019
    Location
    UK
    MS-Off Ver
    Unknown
    Posts
    4

    Re: Assistane with IF array formula needed

    Certainly is an Excel question. Not sure what else it could be mistaken for.

    As you will see I am new here. Thank you for the assistance on how to attach a file.

    I would want this to work for 2000 rows - hopefully the workbook is now attached
    Attached Files Attached Files

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,368

    Re: Assistane with IF array formula needed

    ARRAYFORMULA is a Google Sheets function, hence the question.

    Please update your user profile with the version of Excel that you are using.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,368

    Re: Assistane with IF array formula needed

    In I2 copied down:

    =IF(H2="","",IF(H2>=0.25,H2+0.0208333333333333,H2))

    or this:

    =IF(H2="","",IF(H2>=1/4,H2+(1/48),H2))

  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
    43,893

    Re: Assistane with IF array formula needed

    As Ali said... it could have been a google sheets question. Unfortunately you didn't act on point 3 in my previous post. Your incorrect formua doesn't help me understand exactly what you want. So, please update with a few manually calculated results.

  7. #7
    Registered User
    Join Date
    08-08-2019
    Location
    UK
    MS-Off Ver
    Unknown
    Posts
    4

    Re: Assistane with IF array formula needed

    My knowledge of Excel vs. Google Sheets is not great which is why I was unaware of this. Its a formula I have googled to use. We all have to start somewhere.

    I have have a go with your formula's Ali, thank you for those, and they work but in the opposite way. They add on 30 mins rather than taking them away. Apologies for missing point 3, I had added this now and attach a new example.
    Attached Files Attached Files

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,368

    Re: Assistane with IF array formula needed

    Sorry - my fault!

    Just change them like this:

    In I2 copied down:

    =IF(H2="","",IF(H2>=0.25,H2-0.0208333333333333,H2))

    or this:

    =IF(H2="","",IF(H2>=1/4,H2-(1/48),H2))

    All I've done is change the plus sign to a minus sign.

    Excel 2016 (Windows) 32 bit
    H
    I
    J
    K
    1
    Total Hours Minus 30 min break over 6 hours worked should look like this:
    2
    3
    08:34
    08:04:00
    08:04
    4
    5
    10:35
    10:05:00
    09:35
    6
    etc
    7
    10:14
    09:44:00
    8
    9
    10:39
    10:09:00
    until….
    10
    11
    06:25
    05:55:00
    12
    13
    10:35
    10:05:00
    14
    15
    08:42
    08:12:00
    16
    17
    08:36
    #NAME?
    Sheet: Sheet1

    Why are you expecting the second one to result in 09:35? That would be a deduction of 60 minutes - why?
    Last edited by AliGW; 08-08-2019 at 09:27 AM.

  9. #9
    Registered User
    Join Date
    08-08-2019
    Location
    UK
    MS-Off Ver
    Unknown
    Posts
    4

    Re: Assistane with IF array formula needed

    Thanks Ali, that works now. I was trying to calculate manually (whilst doing a couple of other things at the same time whilst at work) so have miss calculated that one.

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,368

    Re: Assistane with IF array formula needed

    That's fine - I thought that might be it.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. [SOLVED] Help needed on array formula
    By hiXtori in forum Excel General
    Replies: 5
    Last Post: 05-30-2019, 09:32 AM
  2. Array formula needed
    By ZipCurs in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-17-2005, 10:20 AM
  3. Array formula needed
    By Domenic in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 09:05 PM
  4. [SOLVED] Array formula needed
    By David Billigmeier in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 06:05 AM
  5. [SOLVED] Array formula needed
    By Ann in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  6. [SOLVED] Array formula needed
    By Ann in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  7. [SOLVED] Array formula needed
    By Ann in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM

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