+ Reply to Thread
Results 1 to 15 of 15

Combining if formulas

  1. #1
    Forum Contributor
    Join Date
    07-17-2015
    Location
    Roanoke, Virginia
    MS-Off Ver
    2010
    Posts
    173

    Combining if formulas

    How can I connect these formulas into one?

    =IF(Dashboard!$E$2="A",SUMPRODUCT(COUNTIFS($B:$B,H2,$E:$E,{"A";"com1"})))
    =IF(Dashboard!$E$2="W",SUMPRODUCT(COUNTIFS($B:$B,H2,$E:$E,{"W";"com1";"com2"})))
    =IF(Dashboard!$E$2="VS",SUMPRODUCT(COUNTIFS($B:$B,H2,$E:$E,{"VS";"com2"})))
    =IF(Dashboard!$E$2="S",SUMPRODUCT(COUNTIFS($B:$B,H2,$E:$E,{"S"})))

    Thanks
    Jim

  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. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,568

    Re: Combining if formulas

    I can't test this for you, but see if it works:

    =CHOOSE(LOOKUP(Dashboard!$E$2,{"A","W","VS","S"},{1,2,3,4}),SUMPRODUCT(COUNTIFS($B:$B,H2,$E:$E,{"A";"com1"})),SUMPRODUCT(COUNTIFS($B:$B,H2,$E:$E,{"W";"com1";"com2"})),SUMPRODUCT(COUNTIFS($B:$B,H2,$E:$E,{"VS";"com2"})),SUMPRODUCT(COUNTIFS($B:$B,H2,$E:$E,{"S"})))
    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
    Forum Contributor
    Join Date
    07-17-2015
    Location
    Roanoke, Virginia
    MS-Off Ver
    2010
    Posts
    173

    Re: Combining if formulas

    Thank you Worked great!

  4. #4
    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. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,568

    Re: Combining if formulas

    I'm pleased to hear it!

  5. #5
    Forum Contributor
    Join Date
    07-17-2015
    Location
    Roanoke, Virginia
    MS-Off Ver
    2010
    Posts
    173

    Re: Combining if formulas

    I spoke a little early - it's not changing the VS and S if the Dashboard has those characters selected in E2
    I'll keep working at it - you did great and put me on a direction

  6. #6
    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. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,568

    Re: Combining if formulas

    Maybe the first lookup array needs semi-colons:

    {"A";"W";"VS";"S"}

  7. #7
    Forum Contributor
    Join Date
    07-17-2015
    Location
    Roanoke, Virginia
    MS-Off Ver
    2010
    Posts
    173

    Re: Combining if formulas

    tried that - good thought - still no

  8. #8
    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. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,568

    Re: Combining if formulas

    Oh, dear. So explain in more detail: what is actually failing? Is it working for the A and W references, but not VS and S? Maybe if you attached the workbook here, we could fix it for you.

  9. #9
    Forum Contributor
    Join Date
    07-17-2015
    Location
    Roanoke, Virginia
    MS-Off Ver
    2010
    Posts
    173

    Re: Combining if formulas

    Doesn't look like I can attache since it is listed as Solved.
    I'll try to send a new post with a workbook in less than 5 mins

  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. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,568

    Re: Combining if formulas

    It being marked as solved has nothing to do with it, but the paperclip icon does not work!

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

    DO NOT START A NEW THREAD!!!
    It would breach the forum rules.

  11. #11
    Forum Contributor
    Join Date
    07-17-2015
    Location
    Roanoke, Virginia
    MS-Off Ver
    2010
    Posts
    173

    Re: Combining if formulas

    thanks here you go
    Vehicles I:I is formula
    Dashboard is E2
    Counties E:E pulls from Vehicles I:I and COunties F:F pulls from Dashboard C2 - - Counties creates the pivot that is used on the Dashboard
    Attached Files Attached Files

  12. #12
    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. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,568

    Re: Combining if formulas

    Schoolgirl error - sorry!
    Give me a mo ...
    Needed to be in ascending order alphabetically ... Doh!

  13. #13
    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. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,568

    Re: Combining if formulas

    This should do it:

    =CHOOSE(LOOKUP(Dashboard!$E$2,{"A","S","VS","W"},{1,2,3,4}),SUMPRODUCT(COUNTIFS($B:$B,H2,$E:$E,{"A";"com1"})),SUMPRODUCT(COUNTIFS($B:$B,H2,$E:$E,{"S"})),SUMPRODUCT(COUNTIFS($B:$B,H2,$E:$E,{"VS";"com2"})),SUMPRODUCT(COUNTIFS($B:$B,H2,$E:$E,{"W";"com1";"com2"})))

  14. #14
    Forum Contributor
    Join Date
    07-17-2015
    Location
    Roanoke, Virginia
    MS-Off Ver
    2010
    Posts
    173

    Re: Combining if formulas

    I would never had known! I don't see choose & Lookup very often - very nice formula - and one I can archive for future use!
    Thanks
    Jim

  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. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,568

    Re: Combining if formulas

    You're welcome! Could you do something about the extra thread you started (but didn't need)?

+ 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. Combining formulas
    By airedale360 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-13-2016, 12:07 PM
  2. Combining formulas
    By jawebb in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-28-2016, 04:57 AM
  3. Combining 3 formulas
    By lostweasel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-07-2015, 10:36 AM
  4. combining 2 formulas
    By josh101287 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-21-2015, 04:31 PM
  5. Combining IF formulas
    By donyc in forum Excel General
    Replies: 4
    Last Post: 09-09-2010, 05:42 PM
  6. combining IF formulas
    By donyc in forum Excel General
    Replies: 2
    Last Post: 09-08-2010, 09:31 AM
  7. Combining three formulas
    By neil676 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-17-2009, 09:44 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