+ Reply to Thread
Results 1 to 11 of 11

Nested COUNTIF / IF formula for data validation workaround

  1. #1
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Nested COUNTIF / IF formula for data validation workaround

    I have a table with several columns for end user entry. Because I'm using formulas in the cells, I can't use data validation (nor VBA), but I still want to let end users know if they've entered data correctly or not, so I created an additional helper column, col. W, to check their entries.

    There are 10 questions in Part 1, columns I-R (Q1-Q10), and an addition 4 questions in Part 2, columns S-V (Q11-Q14). The trick is the in column G asks if they are answering only the first 10 (Part 1), and all 10 must be either 'y' or 'n', or if they are answering all 14 questions, the last four answered with either, 'y', 'n', or 'n/a'.

    FYI, I have an additional column H (All Yes) which will automatically put y's in questions 1-10 or 1-14, depending on the entry in col. G. So I'm looking at a rather complex, nested IF and COUNTIF formula for column W, that will return either "OK" or "Error." It should return 'OK' if all 14 questions are being answered (no blanks) AND if Q1-Q10 are all answered either y or n AND if Q11-Q14 are answered y, n, or n/a. If there is a blank OR if there is an value other than y or n for Q1-Q10 or a value other than y, n, or n/a for Q11-Q14, then it should return "Error."

    In my sample, rows 2-4 should be "OK" in column W, and "Error" should be returned in rows 6 & 7.

    sample 1a.xlsx
    Last edited by HeyInKy; 03-03-2017 at 01:11 PM.

  2. #2
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Re: Nested COUNTIF / IF formula for data validation workaround

    I think I have been making it too complicated - when I think this will work:

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


    ...but feel free to correct me if I'm wrong or come up with another solution!
    Last edited by HeyInKy; 03-03-2017 at 01:41 PM.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,044

    Re: Nested COUNTIF / IF formula for data validation workaround

    Because I'm using formulas in the cells, I can't use data validation
    why not? Have you tried to?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Re: Nested COUNTIF / IF formula for data validation workaround

    Because data validation will reject the formulas that are present in the cells. I needed a way to know if the end user is just answer the first 10 questions or all 14 (see formula in columns S - V, per col. G), and because a majority of the entries are going to be all Y's (about 10-15% or have at least 1 'n', but that leaves 85-90% at all y's), and because the end user is under some time restraints, I wanted a way to make data entry easier and quicker (hence, see formula in columns J - R, per col. H).

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,044

    Re: Nested COUNTIF / IF formula for data validation workaround

    oops sorry, for some reason I saw DV but read Conditional Formatting - DONT ask how I managed that LOL

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,044

    Re: Nested COUNTIF / IF formula for data validation workaround

    Come to think of it, why cant you use CF to show an error? You could make the cell change color if the answer is not what was expected

  7. #7
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Re: Nested COUNTIF / IF formula for data validation workaround

    Haha, no worries... I'm pretty sure my formula a few posts above is working though.

  8. #8
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Re: Nested COUNTIF / IF formula for data validation workaround

    Quote Originally Posted by FDibbins View Post
    Come to think of it, why cant you use CF to show an error? You could make the cell change color if the answer is not what was expected
    I didn't think of that... does CF work on OWA (Excel Online)? ...that's why I can't use the VBA (or XML, etc.).

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,044

    Re: Nested COUNTIF / IF formula for data validation workaround

    I have never used that, but the best way to find out is to try/test it.

    Thanks for the feedback

  10. #10
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Re: Nested COUNTIF / IF formula for data validation workaround

    Turns out I tested it in Excel Online and it does support CF. Yay!

    So if I do a custom CF formula, would it look like:

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


    OR

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



    Or some combination of those 2? ...am testing now but thought you may know.

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,044

    Re: Nested COUNTIF / IF formula for data validation workaround

    Thats great, thanks for getting back to us

    For complex CF rules, I often create the rule IN the worksheet. It is easier/quicker to test and adjust there, and like you showed, all you need is a formula that will return TRUE (or 1) or FALSE (or 0)

+ 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] Nested COUNTIF and IF Formula
    By neurion in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-04-2015, 05:34 AM
  2. Replies: 5
    Last Post: 07-28-2014, 11:53 AM
  3. [SOLVED] Workaround for Data Validation (List) limitation
    By abousetta in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-04-2013, 06:04 PM
  4. [SOLVED] Help with Data Vailidation workaround when cell has a formula
    By NANDO-T in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-02-2013, 11:31 PM
  5. help on a nested countif/nested if formula
    By vickiemc in forum Excel General
    Replies: 2
    Last Post: 08-13-2008, 08:29 AM
  6. workaround for exceeding 7 nested functions in Excel?
    By marcia21 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-07-2008, 09:27 AM
  7. Replies: 11
    Last Post: 04-21-2006, 11:55 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