+ Reply to Thread
Results 1 to 2 of 2

Searching Multiple Columns for Multiple Variables (Google Sheet)

  1. #1
    Registered User
    Join Date
    10-23-2023
    Location
    Chicago, IL
    MS-Off Ver
    Google Sheets
    Posts
    1

    Searching Multiple Columns for Multiple Variables (Google Sheet)

    EXCEL FIENDS!

    I have an Excel sheet. I want it to sum the hours worked (Column J) for a particular person based on multiple criteria:
    1. If the person's name (A27) appears in any of 3 columns (D,E, or F)

    2. If the row falls within a certain DATE range (between BO1 and BO2) - (Column B)

    3. If the description of the event says "Apples" OR "Oranges" (Column C)
    This works searching only searching Column D:

    =SUMIFS('Sheet 2'!$J:$J,'Sheet 2'!$D:$D,$A27,'Sheet 2'!$B:$B,">="&BO$1,'Sheet 2'!$B:$B,"<="&BO$2,'Sheet 2'!$C:$C,"Apples") + SUMIFS('Sheet 2'!$J:$J,'Sheet 2'!$D:$D,$A27,'Sheet 2'!$B:$B,">="&BO$1,'Sheet 2'!$B:$B,"<="&BO$2,'Sheet 2'!$C:$C,"Oranges")

    ...then I have to copy+paste it in triplicate to search E and F columns:

    +SUMIFS('Sheet 2'!$J:$J,'Sheet 2'!$E:$E,$A27,'Sheet 2'!$B:$B,">="&BO$1,'Sheet 2'!$B:$B,"<="&BO$2,'Sheet 2'!$C:$C,"Apples") + SUMIFS('Sheet 2'!$J:$J,'Sheet 2'!$E:$E,$A27,'Sheet 2'!$B:$B,">="&BO$1,'Sheet 2'!$B:$B,"<="&BO$2,'Sheet 2'!$C:$C,"Oranges")

    + SUMIFS('Sheet 2'!$J:$J,'Sheet 2'!$F:$F,$A27,'Sheet 2'!$B:$B,">="&BO$1,'Sheet 2'!$B:$B,"<="&BO$2,'Sheet 2'!$C:$C,"Apples") + SUMIFS('Sheet 2'!$J:$J,'Sheet 2'!$F:$F,$A27,'Sheet 2'!$B:$B,">="&BO$1,'Sheet 2'!$B:$B,"<="&BO$2,'Sheet 2'!$C:$C,"Oranges")

    I want to know if:

    A) Can I somehow have it search all 3 column for Names at once instead of creating this giant clusterfunk for each individual column.

    B) Why on EARTH can't I get it to look at Apples "OR" Oranges in a single formula like this (searching just Column D for names right now):
    =SUM(SUMIFS('Sheet 2'!$J:$J,'Sheet 2'!$C:$C,{"Apples","Oranges"},'Sheet 2'!$D:$D,$A27,'Sheet 2'!$B:$B,">="&BO$1,'Sheet 2'!$B:$B,"<="&BO$2))

    ^^ That formula gives me only Apples and no Oranges. If I flip the values in the formula around I get Oranges but no Apples. What the heck?

    I have an example link, not an attachment file and having trouble using "Manage Attachments" to share a link to the Worksheet:


    Link is: docs.google.com/spreadsheets/d/1tBAA8AdEOGkh2_lI0nlkV3390bqALsV1VzrhVhrTy1A/edit#gid=0

    File is also attached!!
    Attached Files Attached Files
    Last edited by Brulcifer; 10-23-2023 at 05:49 PM. Reason: Adding a link!

  2. #2
    Forum Contributor
    Join Date
    12-17-2013
    Location
    ON, Canada
    MS-Off Ver
    MS 365
    Posts
    171

    Re: Searching Multiple Columns for Multiple Variables (Google Sheet)

    Hi Brulcifer,

    I added a new tab to your GS workbook and used the Query function to achieve the same results. It's still a lengthy formula....perhaps someone else knows how to shorten it up.

+ 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. Replies: 1
    Last Post: 12-13-2022, 01:01 AM
  2. [SOLVED] Index/Match multiple criteria but searching for matches in multiple columns
    By stearno in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-04-2020, 11:09 PM
  3. Searching Multiple Columns in Separate Sheet for a Match
    By jasonad0017 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-11-2015, 06:38 PM
  4. Searching multiple text strings/variables
    By steve61 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-16-2014, 07:58 AM
  5. Replies: 2
    Last Post: 09-25-2013, 03:17 AM
  6. Searching multiple variables
    By iLurk in forum Excel General
    Replies: 3
    Last Post: 02-17-2010, 04:22 AM
  7. Searching Multiple Columns on Same Sheet
    By boylejob in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-27-2009, 09:53 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