+ Reply to Thread
Results 1 to 8 of 8

Syntax producing an error

  1. #1
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    Excel 2003-2019
    Posts
    869

    Syntax producing an error

    Dear Sir,

    I have a below formula used.

    =IF(SEARCH("TOTAL",H4)="TOTAL","",D4)

    Here,I am finding/Searching the the text "TOTAL" from H4,if there it exist then,it will return to space, else it will return the data that exit in D4.Currently it is producing an error.

    Kindly see where I am wrong in the syntax.

    With Best Rgds,
    Suresh

  2. #2
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2013
    Posts
    1,828

    Re: Syntax producing an error

    Hi,

    Better go for =SUBSTITUTE(

    Provide a sample work book

    Punnam

  3. #3
    Forum Guru XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,508

    Re: Syntax producing an error

    Hi,

    =IF(COUNT(SEARCH("TOTAL",H4)),"",D4)

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

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

    Re: Syntax producing an error

    Try
    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...

  5. #5
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    Excel 2003-2019
    Posts
    869

    Re: Syntax producing an error

    Thanx both of you,that's work great.

    Here, I want to add one more condition.If H4 is equal to either "TOTAL" after seaching or equal to "" (space), then it will produce the result with "" else D4.

    Now here how to club this condition into above formula.

    Thanks once again.

    suresh

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

    Re: Syntax producing an error

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

  7. #7
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    Excel 2003-2019
    Posts
    869

    Re: Syntax producing an error

    Oh! I forget about OR,function.Yeah OR is the perfect here.
    Thanx for your reply.

    Last but not least,If H4 which is searching from "TOTAL",if I want to extract whole texts that contains the text "TOTAL" then in this condition how would be your formula ?

    With Best Rgds,
    suresh

  8. #8
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365 ProPlus
    Posts
    9,544

    Re: Syntax producing an error

    Not sure what do you want exactly, try this to see if this is what you are trying to achieve.

    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

+ 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] Code producing error, only on third run of Userform...?
    By RayJay01 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-12-2019, 10:01 PM
  2. loop that keeps producing a next without for error
    By Sc0tt1e in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 03-26-2014, 04:49 AM
  3. [SOLVED] Workbook Event Producing an Error
    By BeachRock in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-12-2014, 01:42 PM
  4. [SOLVED] Nest LEFT in VLOOKUP producing error
    By msawyer in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 12-07-2012, 07:26 PM
  5. VBA code suddleny producing an error
    By drgogo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-15-2010, 07:18 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