+ Reply to Thread
Results 1 to 5 of 5

Counting columns as condition in SUMIF

  1. #1
    Registered User
    Join Date
    12-25-2017
    Location
    Belgium
    MS-Off Ver
    Excel Professional Plus 2016
    Posts
    2

    Counting columns as condition in SUMIF

    For calculating purchase of new goods in a fleet, I want to check all previous years if goods need to be replaced.
    I looked a lot to try to find an answer but my question is difficult to describe in Google :-(

    See below example

    Please Login or Register  to view this content.
    I tried below formula, but it doesn't work. Any idea's?

    =H2-G2+SUMIF($C3:G3,"=" & (COLUMN(CurrentCell)-COLUMN(G3)+1),$C4:G4)

    All help greatly appreciated!
    Last edited by tomasinjapan; 12-25-2017 at 02:51 PM.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Counting columns as condition in SUMIF

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    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,701

    Re: Counting columns as condition in SUMIF

    Also define “It doesn’t work”, which tells us nothing useful.
    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.

  4. #4
    Registered User
    Join Date
    12-25-2017
    Location
    Belgium
    MS-Off Ver
    Excel Professional Plus 2016
    Posts
    2

    Re: Counting columns as condition in SUMIF

    Sorry for my bad problem explanation.

    But I think I cracked it...
    =H2-G2+SUMIF($C3:G3,"=" & (COLUMN(CurrentCell)-COLUMN(G3)+1),$C4:G4)

    should be:
    =H2-G2+SUMPRODUCT(((COLUMN(H3)-COLUMN($C3:G3))=($C3:G3))*($C3:G3<>"")*($C4:G4))

    Thanks for the feedback

  5. #5
    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: Counting columns as condition in SUMIF

    Once again, please upload a sample workbook. We need context.
    Dave

+ 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. [SOLVED] Counting rows for each user with condition on two columns
    By anahochmanova in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-05-2017, 12:44 PM
  2. Replies: 4
    Last Post: 07-13-2017, 12:24 AM
  3. Counting occurrences not values.. Counting blocks of words in columns
    By Flydd in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 03-01-2016, 06:42 PM
  4. SUMIF with condition
    By kisboros in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-27-2013, 03:37 PM
  5. Counting until a condition and then, again counting from start
    By amitraiforyou in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-13-2010, 05:25 PM
  6. SumIf with more than one condition
    By qwyz in forum Excel General
    Replies: 5
    Last Post: 05-12-2009, 10:02 AM
  7. condition: SUMIF
    By jeremy via OfficeKB.com in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 08-12-2005, 09:05 PM

Tags for this Thread

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