+ Reply to Thread
Results 1 to 15 of 15

How to remove a cell from a formula with a formula

  1. #1
    Registered User
    Join Date
    03-03-2020
    Location
    Maine
    MS-Off Ver
    2010
    Posts
    6

    How to remove a cell from a formula with a formula

    I'm kinda new to excel but not so much to programming however, I have run into a snag trying to complete a formula to remove cells from a different formula if they equal zero. The data in these cells change month to month and instead of removing the cells from the equation manually I'm trying to set up a formula to do it automatically.

    So here is the original formula:

    =MIN(M19:N49)

    Simple right. Find the lowest number in the dataset. The issue is that cells that return 0 mean that no data was collected for that day. To give an example in February this year there is 29 days. That means days 30 and 31 will return 0. M19/N19 = day 1 and M49/N49 = day 31. So I tried to create a formula to fix this issue automatically by looking at the dataset for 0's and then removing them from the equation to give me a real minimum number.

    This formula is where I'm at:

    =IF(M19:N49=0,M50-(M19:N49=0))

    I tried to amend the original formula ~=MIN(M19:N49)~ as well to include the removal of the cells that equal zero but I'm honestly at a loss. Can someone help me?

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: How to remove a cell from a formula with a formula

    Hi,

    Try MINIFS...

    =MINIFS(M19:N49,M19:N49,">0")
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: How to remove a cell from a formula with a formula

    I don't think Minifs is available with EXCEL 2010 . Copy paste below then hold control and shift together then hit enter to make it array formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  4. #4
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: How to remove a cell from a formula with a formula

    Yup, as Hemesh says - you need a more recent version of excel for MINIFS to work. Sorry!

  5. #5
    Registered User
    Join Date
    03-03-2020
    Location
    Maine
    MS-Off Ver
    2010
    Posts
    6

    Re: How to remove a cell from a formula with a formula

    Quote Originally Posted by sweep View Post
    Hi,

    Try MINIFS...

    =MINIFS(M19:N49,M19:N49,">0")
    This returned with a #NAME?

    But looking at the formula you provided I'm not sure how this would work.

    test: M19:N49
    true: M19:N49
    false: ">0"

    That doesn't seem quite right.

  6. #6
    Registered User
    Join Date
    03-03-2020
    Location
    Maine
    MS-Off Ver
    2010
    Posts
    6

    Re: How to remove a cell from a formula with a formula

    Quote Originally Posted by hemesh View Post
    I don't think Minifs is available with EXCEL 2010 . Copy paste below then hold control and shift together then hit enter to make it array formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Array formulas are not available for merged cells.

    And it returned with a #Value!


    Thank you for helping me with this

  7. #7
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: How to remove a cell from a formula with a formula

    unmerge the cell to apply array formula see the attachment and change the range accordingly,
    Array formulas are enter by holding control and shift together then by hitting enter instead of just enter
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    03-03-2020
    Location
    Maine
    MS-Off Ver
    2010
    Posts
    6

    Re: How to remove a cell from a formula with a formula

    Quote Originally Posted by hemesh View Post
    unmerge the cell to apply array formula see the attachment and change the range accordingly,
    Array formulas are enter by holding control and shift together then by hitting enter instead of just enter
    We need the merged cell to submit the form to the state, it's actually their form not ours. We just enter the information in (well we have programs doing it automatically) and then send it all to them.


    Am I to understand that what I am asking can't be done in excel2010?
    Last edited by Water2; 03-03-2020 at 01:47 PM.

  9. #9
    Registered User
    Join Date
    03-03-2020
    Location
    Maine
    MS-Off Ver
    2010
    Posts
    6

    Re: How to remove a cell from a formula with a formula

    =AVERAGEIF(D19:D48,"<>0")

    Is there a minimum value equivalent to this above?

    This works for averaging.

  10. #10
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: How to remove a cell from a formula with a formula

    can you post a sample workbook (instructions in the yellow banner at the top of the post)? Otherwise we'll just keep guessing.
    We don't need a lot of data, just a representative sample AND don't forget to include an expected result.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  11. #11
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: How to remove a cell from a formula with a formula

    rereading your post #6, if your merged cells are M19, N19 and M20, N20 etc. I tried the minif array formula offered by hemesh on my own merged group of cells and it worked fine.
    Are you sure you activated it properly?

  12. #12
    Registered User
    Join Date
    03-03-2020
    Location
    Maine
    MS-Off Ver
    2010
    Posts
    6

    Re: How to remove a cell from a formula with a formula

    Here is a sample
    Attached Files Attached Files

  13. #13
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: How to remove a cell from a formula with a formula

    I don't understand what relevance A1:A10 has to your data in M19:N49. You have no data in M19:N49 and I do not see any merged cells.
    Also your formula in A12 wasn't activated using ctrl+shift+enter which you need to do to activate an array formula so the {} appear at each end.
    But without any data in M19:N49 - even if you activate it you still will not get any answer.

  14. #14
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: How to remove a cell from a formula with a formula

    In the meantime this method will work in Excel 2010.

    Max <> 0
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    for Min <> 0
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  15. #15
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: How to remove a cell from a formula with a formula

    The following doesn't require array formula entry, but it performs additional calculations.

    =MIN(INDEX(M19:N49+1E300*(M19:N49<=0),0))

    This works by adding a huge number to nonpositive values. INDEX(array,0) eliminates the need for array formula entry as long as the array term uses little more than arithmetic or string operators.

+ 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. UDF to remove text from cell formula
    By DesM in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 09-06-2017, 09:47 AM
  2. [SOLVED] remove number from cell with a formula
    By MetteGaga in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-17-2016, 07:52 AM
  3. Formula to remove text from a cell
    By Backroomgeeza in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-18-2013, 02:40 PM
  4. Remove formula from cell
    By LB79 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2010, 07:57 AM
  5. Remove Formula from cell if condition met
    By Vikash Jain in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-23-2009, 06:08 AM
  6. formula to remove numbers out of a cell.
    By mikeburg in forum Excel General
    Replies: 1
    Last Post: 03-28-2008, 10:58 PM
  7. [SOLVED] How can I remove a formula from a cell and still have the value?
    By Lannutslp in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-14-2005, 02:06 PM

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