+ Reply to Thread
Results 1 to 9 of 9

Formula not recognising cells as blank with formulas that return "" (empty text)

  1. #1
    Registered User
    Join Date
    05-26-2013
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    79

    Question Formula not recognising cells as blank with formulas that return "" (empty text)

    Hi All,

    I am trying to set up a sheet that will automatically generate a table/list of all possible combinations of 3 seperate lists of data. I have essentially got what I want however as I wish to change the base list lengths from time to time, the generation of all the combinations has to be flexible such that it doesnt do what it is doing for me in this example I have attached.

    Combination_Generation.xlsx

    I shall explain this spreadsheet.
    Collumns A, B and C contain my base list data, that is, the days of the month, the asset numbers of assets that will be working that month and the shifts that they will work. Column C will not change in length, however column A and B will as the length of the month will change and the number and type of assets used in that month will change. Column A is generated in reference to cell L2 (which is determined from L1). Column E then generates the first set of combinations followed by Column F which adds the final combination as you can see.

    It is important to note that I have dragged the formula in column E down to the 26th row (highlighted in grey) as list B will change in length (potential length change shown by red highlight). This works fine and returns blank cells as per the formula ("") depending on the length of list B. However, Column F is reading the blanks in column E and using them in the final combination function which as a result is returning false combinations as I have highlighted in orange (for the first occurence). (Ignore data in columns G, H & I)

    How can I fix this?

    Any help will be greatly appreciated and thankyou in advance.

    Kind Regards,

    Ben

  2. #2
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Formula not recognising cells as blank with formulas that return "" (empty text)

    Without changing the logic, your existing formulas in col F can be changed as below :
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and copy down.

    Else you need to go for array formulas..
    If my assistance has helped, there is a reputation icon * on the left hand corner below the post - you can show your appreciation to the user who has helped in resolving your requirement.

    If your requirement has been solved please mark your thread as Solved.
    In the menu bar above the very first post, select Thread Tools, then select "Mark this thread as Solved".

    Kindly use [FORMULA] or [CODE] tags when posting your code.

    Regards,
    Sarang

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Formula not recognising cells as blank with formulas that return "" (empty text)

    instead counta(E:E) which gives 26
    you could use
    =COUNTIF(E:E,"?*") which =14
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,367

    Re: Formula not recognising cells as blank with formulas that return "" (empty text)

    Change the blue highlighted:

    =IF((COUNTA(B:B)*$L$2*2)>(COUNTA($F$1:OFFSET(F1,-1,0))),IF(ROW()-ROW($F$1)+1>COUNTA(A:A)*COUNTA(E:E),"",INDEX(A:A,INT((ROW()-ROW($F$1))/COUNTA(E:E)+1))&"/"&INDEX(E:E,MOD(ROW()-ROW($F$1),COUNTA(E:E))+1)),"")

    with this:
    COUNTIF(E:E;"*?")

  5. #5
    Registered User
    Join Date
    05-26-2013
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    79

    Re: Formula not recognising cells as blank with formulas that return "" (empty text)

    What you have there sort of makes sense to me, however, unfortunately Excel cannot make sense of it :/

    I get an error saying;

    "You've entered too many arguments for this function. To get help with this function, click OK to close this message. Then click the Insert Function button located to the left of the equal sign in your formula."

    Which I have done and it turns out the following logical test is volatile:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Any suggestions?

    Also I have used array formulas before, do you think this would be more appropriate? I think the main problem is that the COUNTA function will still count a cell that is empty if it has a formula in it, which is a problem with excel as you cannot have a truly empty cell with a formula still applied to it. I dont wish to delete the formula for the empty cells like some suggest as this will mean that the sheet has to be edited each time the list length changes, which I can do, but the people I am making this for not so much. Any other ways around this dilema?

    Cheers

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Formula not recognising cells as blank with formulas that return "" (empty text)

    Here is the formula in F15, the first orange cell.

    =IF((COUNTA(B:B)*$L$2*2)>(COUNTA($F$1:OFFSET(F15,-1,0))),IF(ROW()-ROW($F$1)+1>COUNTA(A:A)*COUNTA(E:E),"",INDEX(A:A,INT((ROW()-ROW($F$1))/COUNTA(E:E)+1))&"/"&INDEX(E:E,MOD(ROW()-ROW($F$1),COUNTA(E:E))+1)),"")

    I have not broken this all the way down but I noted that you are taking COUNTA(A:A) which is 2000 (not 31). This is because it is not counting blank cells, it is counting non-empty cells. There are 2000 cells in column A with formulas. I don't know which one you really intend but using the total number of non-empty cells does not seem useful. By the same token, COUNTA(E:E) is 26 (not 14).

    Overall I have a feeling that this is much more complicated than necessary. I will give this some thought and make a suggestion after a good night's sleep unless someone beats me to it.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  7. #7
    Registered User
    Join Date
    05-26-2013
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    79

    Re: Formula not recognising cells as blank with formulas that return "" (empty text)

    Azumi,

    AWESOME! I had seen this method used once before but didnt know how to apply it. Looks like it works a charm. Thumbs up!, Thankyou!

    Spicey_888

    EDIT: Sorry there is still a problem :/
    Last edited by Spicey_888; 07-03-2014 at 10:33 PM.

  8. #8
    Registered User
    Join Date
    05-26-2013
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    79

    Re: Formula not recognising cells as blank with formulas that return "" (empty text)

    OK sorted!

    That "Problem" was because I hadn't replace all the COUNTA(E:E) with COUNTIF(E:E,"?*"). So thankyou martindwilson for particularly pointing that out.

    Thanks all for your help, I shall add reputation for everyones combined effort. Really appreciated! :D

    Ben

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Formula not recognising cells as blank with formulas that return "" (empty text)

    I know you marked this as SOLVED but I have a somewhat simplified solution that I thought would be of interest. It doesn't require building intermediate results then breaking them back down again to the final results.

    This file is set up for up to 500 combinations. For more, just copy the formulas in H:M down as far as necessary.
    Attached Files Attached Files

+ 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. Printing cells with formulas that return "blank value"
    By Nell1606 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-04-2013, 10:18 PM
  2. [SOLVED] "IF" to "IFERROR" (or other formula) help by skipping empty cells
    By slack578 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-10-2013, 03:50 PM
  3. [SOLVED] average formula without using cells that have "empty" formulas
    By kreckzin in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-25-2012, 03:24 AM
  4. Replies: 3
    Last Post: 02-16-2011, 02:55 PM
  5. Replies: 2
    Last Post: 03-03-2006, 02:45 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