+ Reply to Thread
Results 1 to 4 of 4

IF formula to read whole column for certain text

Hybrid View

  1. #1
    Registered User
    Join Date
    10-18-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    11

    IF formula to read whole column for certain text

    I have created an excel workbook with 30 worksheets. Within the 30 worksheets is a list of tasks that are created everyday. In column D of each worksheet is the title Done yes/no. So when the task is completed by the end user they are to change the word from yes to no.

    I have created a cover sheet that lists all the worksheets by their name. On the cover sheet against each worksheet name I am trying to create a formula that reads the individual worksheet and every time the word in Column D appears with the text "no" it will populate on the coversheet with the word "NEW". It is designed to highlight which worksheets has a new task listed to avoid the need on clicking every worksheet to see if a new task has been created.

    I have written the following formula but it is not reading the whole column to search for the word "no". If the word "yes" appears in the row under the heading it responds with the answer "FALSE" although there are several rows with the answer "no" in them. I have labelled the column D with a range name hoping that would solve it but I am still getting the same response.

    My formula reads: =IF(ActionBEL="no","NEW")
    Column D = range name "ActionBEL"

    Is there a different style of formula I need to write to read the whole column and respond with the text "NEW" if there is a "no" sitting anywhere in the column?

  2. #2
    Valued Forum Contributor spitfireblue's Avatar
    Join Date
    01-29-2015
    Location
    Adelaide, Australia
    MS-Off Ver
    2007,2010,2016
    Posts
    611

    Re: IF formula to read whole column for certain text

    What you need is a countif... i.e. if the count of "no" in column D is greater than 0 then show "NEW"
    Formula: copy to clipboard
    =IF(COUNTIF(ActionBEL,"no")>0,"NEW")


    What I would suggest is if you have the names of each sheet in column A of your summary then you can adjust the formula like this:
    Formula: copy to clipboard
    =IF(COUNTIF(INDIRECT(A2&"!D:D"),"no")>0,"NEW")

    (where A2 is the first sheet name)
    Regards,
    Stephen

    If you feel someone has helped you please thank them and click on the star on their post to add reputation.
    Please ensure that you use code tags where relevant, and mark solved threads as solved.
    Most of all please be respectful and understanding of others.

  3. #3
    Registered User
    Join Date
    10-18-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    11

    Re: IF formula to read whole column for certain text

    Thank you your formula worked and I will use it for further spreadsheets.

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,442

    Re: IF formula to read whole column for certain text

    .
    Here is a VBA approach:

    Option Explicit
    
    Sub Button1_Click()
        Dim Rws As Long, Rng As Range, ws As Worksheet, sh As Worksheet, c As Range, x As Integer
        Set ws = Worksheets("Sheet1")  'specify sheet name here to paste to
        x = 2   'begins pasting in Sheet 1 on row 2
        Application.ScreenUpdating = 0
        For Each sh In Sheets
            If sh.Name <> ws.Name Then
                With sh
                    Rws = .Cells(Rows.Count, "D").End(xlUp).Row 'searches Col D all sheets
                    Set Rng = .Range(.Cells(1, "D"), .Cells(Rws, "D"))
                    For Each c In Rng.Cells
                        If c.Value = "No" Then  'searches for term NO
                            c.EntireRow.Copy Destination:=ws.Cells(x, "A")
                            x = x + 1
                        End If
                    Next c
                End With
            End If
        Next sh
    End Sub
    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. Formula to read an specific column based on another cell value
    By LEORITY in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-17-2017, 06:33 PM
  2. get formula to read a column upside-down
    By jono121ukk in forum Excel Formulas & Functions
    Replies: 37
    Last Post: 08-28-2016, 04:10 PM
  3. [SOLVED] Figures read as text and numbers in the same column
    By Saturn in forum Excel General
    Replies: 1
    Last Post: 01-24-2016, 07:29 AM
  4. Replies: 4
    Last Post: 02-01-2012, 10:43 AM
  5. format formula to read as text only
    By PYEHL in forum Excel General
    Replies: 2
    Last Post: 01-20-2011, 01:39 PM
  6. How to read the column which include text and number in the excel via ODBC?
    By winniewang11 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-12-2008, 06:39 AM
  7. Formula to read two column come back with one value?
    By Barbie in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-18-2005, 10:06 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