+ Reply to Thread
Results 1 to 14 of 14

Help with If or Concentrate forumla

  1. #1
    Forum Contributor
    Join Date
    10-15-2013
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    218

    Help with If or Concentrate forumla

    Hello All,

    I'm trying to create a worksheet where if I find an error i just put "X" into a square.

    In a comments Column i would like a summary of all the "X"s that I marked for a particular row.

    See attached. Worksheet.xlsx

    In my example in Row 3 i would have placed X in column B, G and J. In column A i want the text to read:

    "Logs Missing
    Vehicle Number Missing
    Name Not Printed"

    but each spaced one down so that they don't colide and become

    "Logs MissingVehicle Number MissingName Not Printed"

    Not sure if this is an IF formula or a Concentrate formula or combination of.

    Any help is appreciated.

    Thanks!

  2. #2
    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
    44,053

    Re: Help with If or Concentrate forumla

    To do that you need a bit of VBA (see module 1 in view code) "borrowed" from Chip Pearson, and a UDF called String Concat - which needs to be set as an array formula.

    Array Formulae are a little different from ordinary formulas in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly braces { } appear around the outside of your formula. If you do not CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly braces yourself - it won't work...

    =StringConcat(","&CHAR(10),IF(B3:AH3="X",$B$1:$AH$1,""),"")

    Remember to enable macros when opening....
    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

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Help with If or Concentrate forumla

    Enter formula in B3, copy across and down

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    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
    44,053

    Re: Help with If or Concentrate forumla

    Hi... We read this one completely dfifferently!! I assumed that the OP wanted us to assemble the summary, not populate the sheet with x's....

  5. #5
    Forum Contributor
    Join Date
    10-15-2013
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    218

    Re: Help with If or Concentrate forumla

    Hi All,

    Alkey - Sorry if my direction lead to some confusion. Glenn's inturpreted my intentions was correct as I will be populating X's as I review logbooks but would want a summary for quick reference back to the particular Row.

    Glenn - Sorry but i thought this would have been a formula that I could copy into my cells and I do not know how to replicate the VBA code you gave me. I posted a simplified sheet to avoid adding too much information. Attached is the actual worksheet i would like to use.... could you insert your macro into here. Also, i'll be duplicating the worksheet many times over... will this only work on all sheets?

    2016 LGE HOS Worksheet.xlsm

    Thanks again!

  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
    44,053

    Re: Help with If or Concentrate forumla

    If you want all the results in the same cell - you really don't have a choice but to use something like this... Once the code is in place on this workbook, it will work for all sheets in the workbook.

    Have a go. I have added it to this.

    to view the code, right click on a Tab name and navigate to module 1.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    10-15-2013
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    218

    Re: Help with If or Concentrate forumla

    Quote Originally Posted by Glenn Kennedy View Post
    If you want all the results in the same cell - you really don't have a choice but to use something like this... Once the code is in place on this workbook, it will work for all sheets in the workbook.

    Have a go. I have added it to this.

    to view the code, right click on a Tab name and navigate to module 1.
    Hi Glenn,

    Mind moving the VBA into this sheet?
    2016 LGE HOS Worksheet.xlsm

    Sorry, i don't know much about VBA's

    Thanks,

  8. #8
    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
    44,053

    Re: Help with If or Concentrate forumla

    It's done...

  9. #9
    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
    44,053

    Re: Help with If or Concentrate forumla

    Oh Cr@p. I attached the wrong sheet!!!!
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Help with If or Concentrate forumla

    Glenn, that's a lot of code! I wrote something similar a long time ago before I realized that it's better to do most of the work with formulas and as little as possible with code. My opinion anyway. All you need VBA to do is concatenate which is what this code snippet does. Maybe I should have included some error handler of some sort but I can't think of what that would be right now.

    So this array formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    where ConcatY is a UDF looking like this:
    Please Login or Register  to view this content.

    The array formula has to be entered with Ctrl + Shift + Enter of course.

    Edit: Darn! It should be Function ConcatY(FinalRng As Variant) As String. Not that anyone will notice any difference but it's better to make it right.
    Attached Files Attached Files
    Last edited by Jacc; 11-03-2015 at 05:36 PM.
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  11. #11
    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
    44,053

    Re: Help with If or Concentrate forumla

    Jacc, I make no bones about it. I'm no good at all with VBA. I can copy others, but that's all!! But yours is much neater, by far.

  12. #12
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Help with If or Concentrate forumla

    Thanks! The IFERROR was only necessary for the first sample workbook as there were errors, so the formula is in fact even neater.

  13. #13
    Forum Contributor
    Join Date
    10-15-2013
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    218

    Re: Help with If or Concentrate forumla

    Quote Originally Posted by Jacc View Post
    Glenn, that's a lot of code! I wrote something similar a long time ago before I realized that it's better to do most of the work with formulas and as little as possible with code. My opinion anyway. All you need VBA to do is concatenate which is what this code snippet does. Maybe I should have included some error handler of some sort but I can't think of what that would be right now.

    So this array formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    where ConcatY is a UDF looking like this:
    Please Login or Register  to view this content.

    The array formula has to be entered with Ctrl + Shift + Enter of course.

    Edit: Darn! It should be Function ConcatY(FinalRng As Variant) As String. Not that anyone will notice any difference but it's better to make it right.

    Perfect,

    Thanks everyone!

  14. #14
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Help with If or Concentrate forumla


    ''''''''''

+ 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. Make forumla lookup value rather than forumla
    By Jbraviator in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-09-2015, 01:00 PM
  2. Conditional Forumla with Forumla assigned- Help needed
    By MarkoPolo in forum Excel General
    Replies: 3
    Last Post: 03-06-2014, 06:46 PM
  3. [SOLVED] Pickup/Lookup Data from Various Locations/Cells and Concentrate it.
    By Everest in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-18-2012, 09:31 AM
  4. Concentrate email address with selection
    By mdshotgun in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-02-2011, 05:08 AM
  5. Faced Problem while concentrate data with commas
    By pchng2 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-02-2010, 02:15 AM
  6. IF Forumla help
    By Bryan in forum Excel General
    Replies: 3
    Last Post: 02-28-2006, 07:20 AM
  7. Replacing a cell's forumla with the forumla's results?
    By Mooncalf in forum Excel General
    Replies: 2
    Last Post: 01-04-2005, 12:35 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