+ Reply to Thread
Results 1 to 4 of 4

Nesting If with Counta and Countif

  1. #1
    Registered User
    Join Date
    07-24-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    73

    Nesting If with Counta and Countif

    =IF(COUNTA(PartsData!AG2:AI2=0),"", IF(COUNTIF(PartsData!AG2:AI2,"LD")>=1,"1 - Yes","2 - No"))

    The above formula is supposed to do the following:


    1) If Cells Ag2:AI2 contain no data at all then forget the whole thing and leave the formula cell blank
    2) but if at least one of those cells is filled, and if at least one of those filled cells says "LD", then return the value '1 - yes'.
    3) Whereas if at least one of those cells is filled but none say "LD", then return "2 - no"

    I'm not getting any error messages - but the cell is blank when it shouldnt be

    Can anyone help?

    Thanks,
    Henry

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Nesting If with Counta and Countif

    One bracket in the wrong place - corrected (and change highlighted red):

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    07-24-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    73

    Re: Nesting If with Counta and Countif

    Awesome, thanks Olly - it works now as you anticipated.

    Nice to know I wasn't a million miles off!

    Repped.

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Nesting If with Counta and Countif

    Try this...

    =IF(SUMPRODUCT(--(PartsData!AG2:AI2<>"")),IF(COUNTIF(PartsData!AG2:AI2,"LD")>=1,"1 - Yes","2 - No"),"")


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

+ 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. Excel 2007 : CountIF or CountA
    By bjohnsonac in forum Excel General
    Replies: 3
    Last Post: 01-24-2011, 12:46 PM
  2. Excel 2007 : CountA and CountIF
    By DentonHTHS in forum Excel General
    Replies: 3
    Last Post: 04-05-2010, 12:44 AM
  3. [SOLVED] CountIF, CountA,Which one? or neither?
    By amy in forum Excel General
    Replies: 2
    Last Post: 07-20-2005, 04:05 PM
  4. [SOLVED] COUNTA, COUNTIF?
    By Newbie in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-18-2005, 08:06 AM
  5. Counta + Countif
    By maswinney in forum Excel General
    Replies: 0
    Last Post: 02-23-2005, 04:54 PM

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