+ Reply to Thread
Results 1 to 20 of 20

Text string in SUMIF

  1. #1
    Registered User
    Join Date
    11-14-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003
    Posts
    55

    Text string in SUMIF

    Trying to get the formula to include for text.


    =IF(D6<>"",SUMIF(K$2:U$2,"Yes",K6:U6),"")

    So if K6:U6 contains text instead of a number this will be returned in the cell

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Text string in SUMIF

    Please add you excel example, without confidentional information.

    Please also add the desired (expected) result.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    11-14-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003
    Posts
    55

    Re: Text string in SUMIF

    I have manually input the "Nil" value highlighted in red
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Text string in SUMIF

    Maybe, like this.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-14-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003
    Posts
    55

    Re: Text string in SUMIF

    See where you are coming from.

    The result needs to be in cell G6 taken from the SUMIF. Basically extending the formula in cell G5 to include the text option.

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Text string in SUMIF

    Perhaps try HLOOKUP

    =HLOOKUP("yes",H2:R6,5,0)
    Audere est facere

  7. #7
    Registered User
    Join Date
    11-14-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003
    Posts
    55

    Re: Text string in SUMIF

    Unless I'm doing something wrong the HLOOKUP does not give me the flexibility.

    The test string is a variable.

    If any column within cell range $H$2;$R$2 contains "Yes" and any cell intersecting that column contains either a numerical value or text string then that value is returned in the "Selected" column

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Text string in SUMIF

    OK, I'm not sure what you mean - can you show an example where HLOOKUP doesn't give you what you need.....and the required result in that case

  9. #9
    Registered User
    Join Date
    11-14-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003
    Posts
    55

    Re: Text string in SUMIF

    Please Select the yellow cells for Validation text
    Attached Files Attached Files

  10. #10
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Text string in SUMIF

    OK, try this version in G6 copied down

    =HLOOKUP("yes",H$2:R6,ROWS(H$2:R6),0)

  11. #11
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Text string in SUMIF

    Maybe like this.

    See the green cells.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    11-14-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003
    Posts
    55

    Re: Text string in SUMIF

    Quote Originally Posted by daddylonglegs View Post
    OK, try this version in G6 copied down

    =HLOOKUP("yes",H$2:R6,ROWS(H$2:R6),0)

    Works with "Nil" but no other variables.
    Column A can has a lot of cells unpopulated hence the reason for my original formula with the "" cell exclusion.

  13. #13
    Registered User
    Join Date
    11-14-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003
    Posts
    55

    Re: Text string in SUMIF

    Quote Originally Posted by oeldere View Post
    Maybe like this.

    See the green cells.
    Unfortunately this sums the entire row.
    Please see previous response.

  14. #14
    Valued Forum Contributor
    Join Date
    02-05-2013
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2013
    Posts
    571

    Re: Text string in SUMIF

    Hope this help you:
    in column G :
    Please Login or Register  to view this content.
    in column B:
    Please Login or Register  to view this content.
    Last edited by SDCh; 02-09-2013 at 06:58 PM.

  15. #15
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Text string in SUMIF

    In your post #3 you also sums the data in the whole row (H5:R5)

    Dutch
    Please Login or Register  to view this content.
    Post #13
    Please Login or Register  to view this content.
    So my questions to you is what should be the action?

  16. #16
    Registered User
    Join Date
    11-14-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003
    Posts
    55

    Re: Text string in SUMIF

    Quote Originally Posted by SDCh View Post
    Hope this help you:
    in column G :
    Please Login or Register  to view this content.
    in column B:
    Please Login or Register  to view this content.
    Please see the enclosed file with notes.
    The result in column B is dependant upon where "Yes" is placed in Row $H$2:$R$2.
    If "Yes" was placed in Column I then cell B9 should return 42.00
    If "Yes" was placed in Column H then cell B9 should return "Excl"

    I think the confusion has come where "Yes" was placed in $G$2. This value was originally a control value only.(I have now removed it)
    Attached Files Attached Files

  17. #17
    Valued Forum Contributor
    Join Date
    02-05-2013
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2013
    Posts
    571

    Re: Text string in SUMIF

    OK, I confused in here, actually what you want with column B?

    If you only want get the value between column where "Yes" are intersect with row Item then this the code:
    Please Login or Register  to view this content.
    Why I confused, because on your first post column B has formula:
    Please Login or Register  to view this content.
    As you see, you want calculate column G, so what happen if the value of column G are "NIL" or "Excl"?

  18. #18
    Registered User
    Join Date
    11-14-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003
    Posts
    55

    Re: Text string in SUMIF

    B9 is the sum of F9*G9 if E9 is blank.
    Else IF E9 ISNUMBER then E9*G9.

    Basically the Directors adjustment in £ overides the Directors adjustment in %

    Hope I'm not confusing things too much here.

  19. #19
    Valued Forum Contributor
    Join Date
    02-05-2013
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2013
    Posts
    571

    Re: Text string in SUMIF

    I change my code on column B:
    Please Login or Register  to view this content.
    As you see, if G9 ="NIL" or G9="Excl" it will take whatever the value that match on intersection.

    By the way, formula on column G is like you want?

  20. #20
    Registered User
    Join Date
    11-14-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003
    Posts
    55

    Re: Text string in SUMIF

    Gents thanks for your help!

    SDCh, Thank you, for showing me the light!!
    Final [SOLVED] draft enclosed
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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