+ Reply to Thread
Results 1 to 4 of 4

Sumif part of a number is found in a string

  1. #1
    Registered User
    Join Date
    01-08-2016
    Location
    Cambodia
    MS-Off Ver
    Office 2012
    Posts
    3

    Sumif part of a number is found in a string

    *Please note, that this is a question regarding Google Sheets, not Excel. Though in my experience, most of what I need works much the same across both.

    I am trying to sum the amount of money spent on a particular date.

    eg. Column B (the date column) shows the date when some money was spent, and may look like this at the end of the month;

    B
    5/5/2019
    5/8/2019
    5/8/2019
    5/11/2019
    5/12/2019

    In order to create my daily report, I would like to sum the expense column (K5:K) based on the data in the date column. For instance, if the cells in the date column contain "/8/", then sum the equivalent cells together from (K5:K) and record that answer in my daily report cell. I would take a guess at the formula; sumif(Expense!B5:5, "*/8/*", Expense!K5:K), though this doesn't work.

    Thank you for your help!
    Last edited by freedannyv; 05-22-2019 at 11:43 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,968

    Re: Sumif part of a number is found in a string

    What you need to understand about dates and times in excel is…

    a date is just a number representing the number of days passed since 1/1/900...and then formatted in a way that we recognize as a date. So, for instance, today (Wed 22 May 2019) is actually 43607

    Time is actually a decimal part of 1 (day), so 06:00 AM is 0.25, 12 noon is 0.5 and 18:00 (or 6 PM) is 0.75

    So, having said that, if your dates are real dates, and not text looking like dates, there is no /8/ in any of those cells.

    That does not mean what you want to do, cant be done. On the contrary, it is relatively simple using SUMIFS() (not sure if Sheets has that function though)

    =sumifs(sum-range, criteria-range1, criteria1, criteria-range2, criteria2....etc)

    So, sumif(Expense!K:K, Expense!B:B, TODAY())

    In retrospect, it seems lile you just need to use SUMIF based on TODAY()
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    01-08-2016
    Location
    Cambodia
    MS-Off Ver
    Office 2012
    Posts
    3

    Re: Sumif part of a number is found in a string

    Thank you for your help FDibbins. I have been working on it today and have found a workaround using =datevalue() in hidden cells. Next to the date cell on the daily report (which I will need to manually type each day (Ctrl and the expense sheet, which is updated immediately as we spend. Once these two share the same date value, I have a solid formula that totals the expenses from the appropriate cells. It looks like this;

    =sumif(Expense!B5:B,A1,Expense!J5:J100)

    A1 is the hidden datevalue() cell from the report.

    Glad to get it fixed, and many many thanks for your help

    Edit* I couldn't use TODAY() as we reopen the spreadsheet tabs regularly to cross check data, so it wasn't suitable for this purpose.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,968

    Re: Sumif part of a number is found in a string

    Happy to help

+ 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. Extracting part number from number string
    By ruub7 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-10-2018, 09:22 AM
  2. SUMIF Condition to Look Part of a NUMBER
    By elaph in forum Excel General
    Replies: 13
    Last Post: 03-16-2017, 08:55 AM
  3. [SOLVED] Remove Part of a String - From Column B Found in Column A
    By sl729 in forum Excel General
    Replies: 3
    Last Post: 05-20-2016, 11:38 AM
  4. [SOLVED] Lookup part number in column and return heading if found
    By Gorbs in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-14-2015, 03:34 PM
  5. [SOLVED] Return the first part of a string up to the first number
    By hvincent in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-24-2014, 07:57 PM
  6. Sumif for part number across date range.
    By chaysp81 in forum Excel General
    Replies: 3
    Last Post: 01-21-2011, 05:02 AM
  7. Replies: 1
    Last Post: 10-15-2007, 10:40 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