+ Reply to Thread
Results 1 to 10 of 10

Search for specific text then add them together

  1. #1
    Registered User
    Join Date
    08-07-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    19

    Search for specific text then add them together

    A report has been generated in excel, there is a column that describes the type of signal it puts out (24,120,etc) i need to be able to identify all the 24 signals and then add up how long the wiring is for all those. so in other words, search column A for a specific term(24,120,etc) then add the column B for all those that have 24, another for 120, etc..

    hope this is clear haha

  2. #2
    Registered User
    Join Date
    10-17-2013
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Search for specific text then add them together

    Hi,

    You need to use SUMIF.

    SO for example, =SUMIF(A2:A30,24,B2:B30)

    Just to note the range in column A needs to be the exact same as column B for it to work!

  3. #3
    Valued Forum Contributor
    Join Date
    10-05-2014
    Location
    Regina, SK Canada
    MS-Off Ver
    Excel for Mac 11
    Posts
    330

    Re: Search for specific text then add them together

    Try using the SUMIF() function, similar to this

    Assumptions:
    Column A has your values in A2:A100 (or as many as you need).
    Column B will have the 24 wiring signal types (13, 120, etc) in cells B2:B25.
    Column C in will have the wiring length needed for those corresponding signal types.

    Enter this formula in cell C2: =SUMIF( A2:A100, ">", B2 )
    Then copy that formula from C2 and paste it into cells B3 to B25. (Or copy down C2 )

    By having the wiring signal types in Column B, your wiring length formulas in column C are more easily adaptable.
    and you have a visual defence as to which result goes with which type.

    Hope this helps
    If this has been helpful, please click on the star at the left.

  4. #4
    Registered User
    Join Date
    08-07-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    19

    Re: Search for specific text then add them together

    the only problem is the range has both integer and text(24DC) how can i incorporate this?

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Search for specific text then add them together

    could you attach a workbook with representative sample data? and the desired result
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  6. #6
    Registered User
    Join Date
    10-17-2013
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Search for specific text then add them together

    Hi,

    So are you searching for 24DC or is there various variations of text after 24?

  7. #7
    Valued Forum Contributor
    Join Date
    10-05-2014
    Location
    Regina, SK Canada
    MS-Off Ver
    Excel for Mac 11
    Posts
    330

    Re: Search for specific text then add them together

    Here a small sample showing how to count each type, where 24, 24DC and 24Ac would each be different types.

    I apologize for an error in my previous answer to you.
    The starting formula in cell C2 should have been: =COUNTIF( $A$2:$A$100, ">" & B2 )

    In the example, the list of measures in column A has been defined as a range with name 'Measures'.
    This simplifies the formula even more and allows for easy expansion or deletion of entries in the 'Measures' area without adjusting the formula.
    Attached Files Attached Files
    Last edited by StuCram; 09-12-2016 at 11:34 AM. Reason: wrong function (Had SUMIF but it should have been COUNTIF)

  8. #8
    Registered User
    Join Date
    08-07-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    19

    Re: Search for specific text then add them together

    i was able to achieve my desire result with the function =SUMIF(F:F,"*120VAC*",O:O) which sums the number of terminations a wire has within the criteria desired(120VAC)

    however when i use the same command format but for column C using =SUMIF(F:F,"*120VAC*",C:C) it returns a value 0 when it shouldnt, any ideas what could cause this?

  9. #9
    Valued Forum Contributor
    Join Date
    10-05-2014
    Location
    Regina, SK Canada
    MS-Off Ver
    Excel for Mac 11
    Posts
    330

    Re: Search for specific text then add them together

    It depends on the data in column C. Is it numeric?
    It would help to see the workbook/worksheet in order to check.

  10. #10
    Registered User
    Join Date
    08-07-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    19

    Re: Search for specific text then add them together

    all the data is numeric in column C i also tried to attach a sample file but wasn't able to browse files


    also worth noting, the values in column C are being populated with the following command [=IFERROR(VLOOKUP(B18, Sheet2!B:S, 18, FALSE),"")]

    ...would this maybe cause some error?
    Last edited by EXCELsior44; 09-13-2016 at 08:33 AM.

+ 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] Search through columns and find specific text and replace that text with header column
    By adamzee in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-09-2014, 11:59 PM
  2. [SOLVED] To search specific text in a cell that contains text string
    By mikail in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-15-2013, 03:02 PM
  3. [SOLVED] Search for specific text using vba
    By newbi004 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-27-2013, 06:57 AM
  4. [SOLVED] search for text in colB, starting with next row search for 1st occurrence of specific #
    By roothog in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-24-2012, 10:39 PM
  5. Replies: 1
    Last Post: 04-27-2012, 07:24 AM
  6. Excel 2007 : Search specific text in a string
    By nlm in forum Excel General
    Replies: 7
    Last Post: 12-14-2011, 05:38 AM
  7. Search for specific text in a row
    By rudolphe in forum Excel General
    Replies: 3
    Last Post: 01-24-2011, 11:51 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