+ Reply to Thread
Results 1 to 30 of 30

Locating text in a column, then adding numbers from the adjacent column.

  1. #1
    Registered User
    Join Date
    12-22-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    9

    Locating text in a column, then adding numbers from the adjacent column.

    I'm an excel novice making a daily assignment sheet for my staff based on the number of procedures in different areas.

    One column of the sheet contains the number of procedures.
    The column next to it will contain the names (non-case sensitive text) of staff.
    Rows represent different work locations.

    I need to be able to find all matching names that will be manually entered down the column and add the number adjacent to their name.

    (The idea is to auto-tally each individual's workload that is manually entered in)

    Let me know if I need to clarify things further, and I appreciate any help!

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Locating text in a column, then adding numbers from the adjacent column.

    Will you please attach a sample Excel workbook?

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    12-22-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    9

    Re: Locating text in a column, then adding numbers from the adjacent column.

    Ok, I made a SUPER generic sheet showing what I want to do.

    I highlighted the stuff I want generated in yellow. Let me know if there's anything else. Thank you so much!
    Attached Files Attached Files

  4. #4
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Locating text in a column, then adding numbers from the adjacent column.

    I think some of your sums were off.

    Try these:

    A17 =INDEX(B$2:B$12,MATCH(0,COUNTIF(B$2:B$12,"<"&B$2:B$12)-SUM(COUNTIF(B$2:B$12,"="&A$16:A16)),0)) Ctrl Shift Enter

    B17 =SUMIF(B$2:B$12,A17,C$2:C$12)

  5. #5
    Spammer
    Join Date
    01-08-2015
    Location
    Cali, Colombia
    MS-Off Ver
    365
    Posts
    302

    Re: Locating text in a column, then adding numbers from the adjacent column.

    Hi, to all!

    If you want a non-cse formula for A17, try this little tweak:
    =INDEX(B$2:B$12,MATCH(,INDEX(COUNTIF(B$2:B$12,"<"&B$2:B$12)-SUMPRODUCT(COUNTIF(B$2:B$12,A$16:A16)),),))

    Blessings!

  6. #6
    Spammer
    Join Date
    01-08-2015
    Location
    Cali, Colombia
    MS-Off Ver
    365
    Posts
    302

    Re: Locating text in a column, then adding numbers from the adjacent column.

    Hi again!

    I leave two options in the file attached.

    Option 1: Formulas --> Same than before.
    Option 2: Power Query (Free add-in Excel 2010 and newer).

    Blessings!
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    12-22-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    9

    Re: Locating text in a column, then adding numbers from the adjacent column.

    63falcondude, yours worked flawlessly - and yes, my sums were probably off... one of the reasons I'm making this sheet to minimize careless errors. Haha.

    johnmpl, I'm working hard to learn the syntax, but I'm not really understanding the reason for/against a non-cse formula (which I assume is the combined logic in a single function by hitting CTRL Shift Enter).

    This has been super helpful so far. I'm struggling to make it all come together the way I want with my real excel sheet I'm working with. If I manage to screw things up, I'll be back for more clarification. Thanks!

  8. #8
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Locating text in a column, then adding numbers from the adjacent column.

    Glad we could help.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  9. #9
    Registered User
    Join Date
    12-22-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    9

    Re: Locating text in a column, then adding numbers from the adjacent column.

    Well, I'm definitely terrible at excel. I tried modifying my own sheet, and a few things are tripping me up. Names are fake, and all identifiers have been removed.

    I'm required keep a certain format layout for consistency in appearance while transitioning from the old paper method of doing assignments.

    Calculated section is highlighted green.

    I've got a few issues:

    1) I've managed to screw up the "total procedures" section. Procedures aren't being added correctly, and I keep screwing it up more as I mess with it.
    2) I'm not sure how to make an exception to skip (necessary) blank cells on the column containing names
    3) Is there a way to make cells remain blank instead of pumping out a "#N/A" when all names have been used? Staffing number varies constantly.

    Once again, thank you for all the help.
    Last edited by CertainlyIndecisive; 12-29-2017 at 10:46 AM.

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Locating text in a column, then adding numbers from the adjacent column.

    See if this helps:

    Excel 2016 (Windows) 32 bit
    I
    J
    5
    =IFNA(INDEX(D$5:D$32,MATCH(0,COUNTIF(D$5:D$32,"<"&D$5:D$32)-SUM(COUNTIF(D$5:D$32,"="&I$4:I4)),0)),"")
    =IF(I5="","",SUMIF(D$5:D$32,I5,G$5:G$32))
    Sheet: Assignment

    The first of the formulae needs array entering, of course, then drag copy both down.

  11. #11
    Registered User
    Join Date
    12-22-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    9

    Re: Locating text in a column, then adding numbers from the adjacent column.

    The Total Procedures column is now working perfectly. Awesome!

    However, the Names column is only outputting "#NAME?" for all cells with the change you suggested. I made sure to do CTRL+SHIFT+ENTER.

    Am I missing something here?

  12. #12
    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
    43,986

    Re: Locating text in a column, then adding numbers from the adjacent column.

    OMG Ali.... that's a bit hard on the eyes...
    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

  13. #13
    Registered User
    Join Date
    12-22-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    9

    Re: Locating text in a column, then adding numbers from the adjacent column.

    Trust me, I cringe at the layout as well - but my staff will not adopt it unless it looks the same as their paper sheets.

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Locating text in a column, then adding numbers from the adjacent column.

    Quote Originally Posted by Glenn Kennedy View Post
    OMG Ali.... that's a bit hard on the eyes...
    As is the workbook it came from ...

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Locating text in a column, then adding numbers from the adjacent column.

    Quote Originally Posted by CertainlyIndecisive View Post
    Am I missing something here?
    Maybe, maybe not. Try this instead:

    =IFERROR(INDEX(D$5:D$32,MATCH(0,COUNTIF(D$5:D$32,"<"&D$5:D$32)-SUM(COUNTIF(D$5:D$32,"="&I$4:I4)),0)),"")

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Locating text in a column, then adding numbers from the adjacent column.

    Quote Originally Posted by CertainlyIndecisive View Post
    Trust me, I cringe at the layout as well - but my staff will not adopt it unless it looks the same as their paper sheets.
    Your staff are blackmailing you? Who's the boss???


  17. #17
    Registered User
    Join Date
    12-22-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    9

    Re: Locating text in a column, then adding numbers from the adjacent column.

    Quote Originally Posted by AliGW View Post
    As is the workbook it came from ...

    Are you inferring there was a previous version stored in that file with identifiers? I pre-emptively deleted it to ensure I stay within forum rules.

    In either case, your last suggestion fixed everything and looks perfect. I appreciate it!

  18. #18
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Locating text in a column, then adding numbers from the adjacent column.

    I am not inferring anything. Nor am I implying (which is what I think you meant) anything about identifiers, about which I know nothing. I was merely referring to the green background.

    Glad to have helped, anyway.

  19. #19
    Registered User
    Join Date
    12-22-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    9

    Re: Locating text in a column, then adding numbers from the adjacent column.

    Quote Originally Posted by AliGW View Post
    Your staff are blackmailing you? Who's the boss???

    I just marked this thread as solved, and I caught one more issue. If any of the cells of the manually entered names are empty, the calculated section for names and procedures outputs "0" for every cell until every cell for names has something entered in it.

    It would be nice to see what the procedure totals are even when all the names haven't been completely entered. Is that possible?

  20. #20
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Locating text in a column, then adding numbers from the adjacent column.

    Post your latest version of the file showing these errors, and I'll take a look.

  21. #21
    Registered User
    Join Date
    12-22-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    9

    Re: Locating text in a column, then adding numbers from the adjacent column.

    Quote Originally Posted by AliGW View Post
    Post your latest version of the file showing these errors, and I'll take a look.
    See attachment. Remove any name from the yellow highlighted cells, and the calculations all become "0". Every cell must have something in it to work, so I guess it needs some kind of excluding criteria for an empty cell.
    Attached Files Attached Files

  22. #22
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Locating text in a column, then adding numbers from the adjacent column.

    I have to go offline now - sorry. I will look in again tomorrow morning and help out if nobody else has stepped in.

  23. #23
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Locating text in a column, then adding numbers from the adjacent column.

    OK, well I have tried various versions of the array formula that I know about, and this is the only one that I can make work in your workbook with blanks in the source data (not sure why). It's a bit of overkill, but it does the job. In I5:

    =IFERROR(INDEX($D$5:$D$32, MATCH(MIN(IF(ISBLANK($D$5:$D$32)+COUNTIF(N1:$N$1, $D$5:$D$32), "", IF(ISNUMBER($D$5:$D$32), COUNTIF($D$5:$D$32, "<"&$D$5:$D$32), COUNTIF($D$5:$D$32, "<"&$D$5:$D$32)+SUM(IF(ISNUMBER($D$5:$D$32), 1, 0))+1))), IF(ISBLANK($D$5:$D$32)+COUNTIF(N1:$N$1, $D$5:$D$32), "", IF(ISNUMBER($D$5:$D$32), COUNTIF($D$5:$D$32, "<"&$D$5:$D$32), COUNTIF($D$5:$D$32, "<"&$D$5:$D$32)+SUM(IF(ISNUMBER($D$5:$D$32), 1, 0))+1)), 0)),"")

    ... 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 your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Once confirmed, drag copy down.

  24. #24
    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
    43,986

    Re: Locating text in a column, then adding numbers from the adjacent column.

    i thought that I had a few solutions that were one-liners; but they mostly seem to collapse if there are a large number of blanks. Ali's seems to work OK. So does this. It's still a bit of a monster, but it's a baby monster (again an array formula):

    =IFERROR(INDEX($D$5:$D$32,MATCH(SMALL(IF(IFERROR((MATCH($D$5:$D$32,$D$5:$D$32,0)=ROW($D$5:$D$32)-MIN(ROW($D$5:$D$32))+1),FALSE),COUNTIF($D$5:$D$32,"<="&$D$5:$D$32)),ROWS(I$4:I4)),COUNTIF($D$5:$D$32,"<="&$D$5:$D$32),0)),"")

    in I5, array entered and copied down
    Attached Files Attached Files

  25. #25
    Spammer
    Join Date
    01-08-2015
    Location
    Cali, Colombia
    MS-Off Ver
    365
    Posts
    302

    Re: Locating text in a column, then adding numbers from the adjacent column.

    Hi, to all!

    Another option, in I5, could be (CSE Formula):
    =IFERROR(INDEX(D$5:D$32,MATCH(,COUNTIF(D$5:D$32,"<"&D$5:D$32)+9^9*(D$5:D$32="")-SUM(COUNTIF(D$5:D$32,I$4:I4)),)),"")

    And drag it down. Blessings!

  26. #26
    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
    43,986

    Re: Locating text in a column, then adding numbers from the adjacent column.

    I like it!!!

  27. #27
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Locating text in a column, then adding numbers from the adjacent column.

    @ johnmpl

    Yes. Very clever.
    Dave

  28. #28
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Locating text in a column, then adding numbers from the adjacent column.

    Quote Originally Posted by Glenn Kennedy View Post
    I like it!!!
    Just seen it and so do I!

  29. #29
    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
    43,986

    Re: Locating text in a column, then adding numbers from the adjacent column.

    TbH... I'm still not confident that I understand it fully... But it works and it's filed away..

  30. #30
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Locating text in a column, then adding numbers from the adjacent column.

    Ditto and ditto.

+ 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. Adding sequential numbers to Column A if Column B has text
    By computer12345 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-28-2015, 09:11 AM
  2. Adjacent Two Column Addition with Text and Numbers
    By Jrsaint in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-16-2013, 01:00 PM
  3. [SOLVED] Restart and increment numbers in column based on changed value in adjacent column
    By Kespin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-03-2013, 06:26 PM
  4. Converting numbers to text in adjacent column
    By Kevingardner1 in forum Excel General
    Replies: 2
    Last Post: 08-03-2011, 10:02 AM
  5. Replies: 4
    Last Post: 05-12-2011, 04:37 PM
  6. Replies: 2
    Last Post: 09-30-2010, 06:02 AM
  7. Locating numbers within a column
    By NextByte in forum Excel - New Users/Basics
    Replies: 18
    Last Post: 06-01-2008, 04:00 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