+ Reply to Thread
Results 1 to 2 of 2

allergens formula

  1. #1
    Registered User
    Join Date
    06-22-2016
    Location
    Usa
    MS-Off Ver
    2013
    Posts
    9

    allergens formula

    I have this sheet that consist on a two step formula
    First I have a search formula to find different words (allergens) 26 to be precise on a cell that contains ingredient information. Once all allergens are identified they are combines with the formula below. However I get a bunch of double commas or comas at the end where they are not needed anymore

    This is the formula that combines only 15 cells and I need 26 to not give me any extra comas or comas at the end

    ="CONTAINS: "&IF(AND(LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TRIM(CONCATENATE(AF208,",",AG208,",",AH208,",",AI208,",",AJ208,",",AK208,",",AL208,",",AM208,",",AN208,",",AO208,",",AP208,",",AQ208,",",AR208,",",AT208)),",,",","),",,",","),",,",","),1)=",",RIGHT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TRIM(CONCATENATE(AF208,",",AG208,",",AH208,",",AI208,",",AJ208,",",AK208,",",AL208,",",AM208,",",AN208,",",AO208,",",AP208,",",AQ208,",",AR208,",",AT208)),",,",","),",,",","),",,",","),1)=","),MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TRIM(CONCATENATE(AF208,",",AG208,",",AH208,",",AI208,",",AJ208,",",AK208,",",AL208,",",AM208,",",AN208,",",AO208,",",AP208,",",AQ208,",",AR208,",",AT208)),",,",","),",,",","),",,",","),2,LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TRIM(CONCATENATE(AF208,",",AG208,",",AH208,",",AI208,",",AJ208,",",AK208,",",AL208,",",AM208,",",AN208,",",AO208,",",AP208,",",AQ208,",",AR208,",",AT208)),",,",","),",,",","),",,",","))-2),IF(LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TRIM(CONCATENATE(AF208,",",AG208,",",AH208,",",AI208,",",AJ208,",",AK208,",",AL208,",",AM208,",",AN208,",",AO208,",",AP208,",",AQ208,",",AR208,",",AT208)),",,",","),",,",","),",,",","),1)=",",RIGHT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TRIM(CONCATENATE(AF208,",",AG208,",",AH208,",",AI208,",",AJ208,",",AK208,",",AL208,",",AM208,",",AN208,",",AO208,",",AP208,",",AQ208,",",AR208,",",AT208)),",,",","),",,",","),",,",","),LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TRIM(CONCATENATE(AF208,",",AG208,",",AH208,",",AI208,",",AJ208,",",AK208,",",AL208,",",AM208,",",AN208,",",AO208,",",AP208,",",AQ208,",",AR208,",",AT208)),",,",","),",,",","),",,",","))-1),IF(RIGHT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TRIM(CONCATENATE(AF208,",",AG208,",",AH208,",",AI208,",",AJ208,",",AK208,",",AL208,",",AM208,",",AN208,",",AO208,",",AP208,",",AQ208,",",AR208,",",AT208)),",,",","),",,",","),",,",","),1)=",",LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TRIM(CONCATENATE(AF208,",",AG208,",",AH208,",",AI208,",",AJ208,",",AK208,",",AL208,",",AM208,",",AN208,",",AO208,",",AP208,",",AQ208,",",AR208,",",AT208)),",,",","),",,",","),",,",","),LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TRIM(CONCATENATE(AF208,",",AG208,",",AH208,",",AI208,",",AJ208,",",AK208,",",AL208,",",AM208,",",AN208,",",AO208,",",AP208,",",AQ208,",",AR208,",",AT208)),",,",","),",,",","),",,",","))-1),SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TRIM(CONCATENATE(AF208,",",AG208,",",AH208,",",AI208,",",AJ208,",",AK208,",",AL208,",",AM208,",",AN208,",",AO208,",",AP208,",",AQ208,",",AR208,",",AT208)),",,",","),",,",","),",,",","))))

    CONTAINS: MILK, SOY, EGG, WHEAT,
    Last edited by Sandy150502; 06-23-2016 at 02:08 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Urgent help with formula

    Hi and welcome to the forum. Unfortunately your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ 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] Urgent! Need to get one row out of that formula:
    By siggiwhite in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-29-2015, 08:42 AM
  2. [URGENT][Help with a VBA Macro - Maximum with criterias][URGENT]
    By mahmoudmerhi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-04-2013, 03:39 PM
  3. Urgent help on what formula I need to use
    By darlahi in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-14-2012, 08:22 PM
  4. Need a formula urgent please help :)
    By drago in forum Excel General
    Replies: 3
    Last Post: 08-06-2009, 07:03 PM
  5. [SOLVED] Urgent Need Help (Formula)
    By Robert Lie in forum Excel General
    Replies: 0
    Last Post: 12-12-2005, 12:40 AM
  6. [SOLVED] Urgent Formula Help
    By Peter Curtis in forum Excel General
    Replies: 19
    Last Post: 01-12-2005, 11:05 PM
  7. [SOLVED] Urgent Formula!
    By Peter Curtis in forum Excel General
    Replies: 4
    Last Post: 01-06-2005, 12:06 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