+ Reply to Thread
Results 1 to 7 of 7

Using INDIRECT with quotation marks

  1. #1
    Registered User
    Join Date
    10-12-2015
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    8

    Using INDIRECT with quotation marks

    Hi all, trying to figure this out but can't find a solution...

    I'm trying to create the following formula using INDIRECT: =COUNTIF(A1,"A")

    (The result of this formula is 1 as A1 contains the letter A)

    I want to grab the letter A in the argument from cell A2.

    This is the formula I've got: =COUNTIF(A1,INDIRECT("""&A2&"""))

    So INDIRECT("""&A2&""") should generate the text "A" - but this does not work. The result of the formula is 0.

    I have also tried a varient: =COUNTIF(A1,INDIRECT(CHAR(34)&A2&CHAR(34)))

    Any idea what's going on? Images attached to help... THANK YOU

    1.JPG
    3.JPG
    2.JPG

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Using INDIRECT with quotation marks

    you might be trying to solve a bigger problem but you are not showing us the full picture. you can't use INDIRECT here as the cell in A2 does not look like a cell reference. how indirect works is more like you have the text "B10" inside cell A5. and B10 has the text "a". then:
    =COUNTIF(A2,INDIRECT(A5))

    but based on your eg, you could simply use:
    =COUNTIF(A2,A2)

    of course, like i said, you might be looking at a bigger picture we don't see.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    10-12-2015
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    8

    Re: Using INDIRECT with quotation marks

    Thanks for that - you're correct that this is part of a bigger problem (was trying to simplify...) here's the actual issue...

    a.JPG

    c.JPG

    I want to count all cells that contain AUFCC in col A if col B contains a Y - but I want to create a smart formula that I can drag down for multiple strings beyond AUFCC... Maybe there is a simpler solution than using INDIRECT...

    Cheers.
    Last edited by eightyfish; 01-17-2019 at 08:53 PM.

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,901

    Re: Using INDIRECT with quotation marks

    Do not using the INDIRECT() function

    =COUNTIFS(B:B,"Y",A:A,"*"&C10&"*")

  5. #5
    Registered User
    Join Date
    10-12-2015
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    8

    Re: Using INDIRECT with quotation marks

    Thank you. Was making it overcomplicated.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Using INDIRECT with quotation marks

    Next time, please post a sheet, not a non-editable picture of one...

    =COUNTIF(A:A,"*"&C3&"*")


    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  7. #7
    Registered User
    Join Date
    10-12-2015
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    8

    Re: Using INDIRECT with quotation marks

    Will do, thank you.

+ 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] Displaying Quotation Marks with the Indirect Function
    By burlywood66 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-19-2013, 02:18 PM
  2. Quotation Marks Getting in the Way
    By Vladamir in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-12-2012, 06:50 PM
  3. Quotation Marks?
    By LinearChaos in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-25-2006, 05:37 PM
  4. [SOLVED] without quotation marks?
    By jfazz in forum Excel General
    Replies: 1
    Last Post: 03-02-2006, 12:45 PM
  5. Quotation Marks - When and What??
    By heski in forum Excel General
    Replies: 2
    Last Post: 02-07-2006, 08:45 AM
  6. quotation marks
    By JohnF in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-05-2006, 05:35 PM
  7. quotation marks
    By Hippy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-04-2005, 07:10 PM
  8. [SOLVED] Quotation Marks
    By kosecki in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-31-2005, 10:05 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