Results 1 to 3 of 3

Thread: [RESOLVED] Selection in Excel

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2008
    Location
    NorthYorkshire UK
    Posts
    5

    Resolved [RESOLVED] Selection in Excel

    I have an Excel spreadsheet which has a field which contains both the name of the product and additional information about the product eg Zebra LP2824P 2" DT desktop printer, parallel with Dispenser (UK/EU)

    I want to find out how many times in the spreadsheet the word "Zebra" appears. I have tried using the VB code:

    =SUMPRODUCT(--(MONTH($B$2:$B$250)=7),--($D$2:$D$250="Zebra")) However this only finds the lines that only contains the word "Zebra" where there is nothing else in the cell.

    Is there a way of selecting the word from the whole string?

    Grateful for any help you can offer.

  2. #2
    Head Hunted anhn's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    3,669

    Re: Selection in Excel

    Firstly, why -- ?

    Try this:
    =SUMPRODUCT((MONTH($B$2:$B$250)=7)*NOT(ISERROR(FIND("Zebra",$D$2:$D$250))))
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • If your question was answered please use Thread Tools to mark your thread [RESOLVED]
    • Don't forget to RATE helpful posts

    • Baby Steps a guided tour
    • IsDigits() and IsNumber() functions • Wichmann-Hill Random() function • >> and << functions for VB • CopyFileByChunk

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2008
    Location
    NorthYorkshire UK
    Posts
    5

    Re: Selection in Excel

    Thank you I will try this. The data comes from a SQL database which the administrator will not give me access to so I just get a dump each week which I have to pull the bones out of!!

    Many thanks again

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width