+ Reply to Thread
Results 1 to 8 of 8

Using SUM on an IF formula column

  1. #1
    Registered User
    Join Date
    11-17-2021
    Location
    London, England
    MS-Off Ver
    Microsoft 365 for Enterprise
    Posts
    4

    Using SUM on an IF formula column

    Hi,
    I have a column using a simple IF formula - basically gives either the outcome of a 2 or 4 depending on the letter inputted on another column.

    Ideally, I'd like to use the SUM formula on this column, so adding all the 2s and 4s up.

    However this doesn't appear to work on the output of the formula. Is there any workaround for this?
    Last edited by Shoequeeny; 11-17-2021 at 11:56 AM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Using SUM on an IF formula column

    Hello and welcome to the forum.
    Yes, but you're really not giving us much to work with.

    You should be able to use a SUMIFS() to do this but if you want a more considered answer upload the workbook.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Using SUM on an IF formula column

    Hi
    what do you mean by " doesn't work". the SUM function ( like =SUM(a1:a10)) does the job
    I suspect your outcomes are text looking like numbers ? If so the cell content is left aligned ( without manual alignment)
    Is your If formula something like =IF( condition met,"2","4")
    ?
    You just have to remove the double quotes ( they return text strings) =IF( condition met,2,4)
    If not post a sample sheet ( see top of page for how-to).
    ?

  4. #4
    Registered User
    Join Date
    11-17-2021
    Location
    London, England
    MS-Off Ver
    Microsoft 365 for Enterprise
    Posts
    4

    Re: Using SUM on an IF formula column

    Sure - attached are the two columns in question. As you can see, pretty straightforward - I just want to sum ColB. I've done a workaround of COUNTIF atm and then multiplied as I wasn't getting very far with SUMIF.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-17-2021
    Location
    London, England
    MS-Off Ver
    Microsoft 365 for Enterprise
    Posts
    4

    Re: Using SUM on an IF formula column

    Hi, thank you - I've posted a sample. The basic SUM formula doesn't work and removing double quotes makes the formula invalid I'm afraid.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Using SUM on an IF formula column

    As Pepe suggested you are using literal characters, i.e. "2" & "4" not 2 & 4
    Change your formula to

    =IF($A3="D",4, IF($A3="S",2))

    Then use SUMIF()

  7. #7
    Registered User
    Join Date
    11-17-2021
    Location
    London, England
    MS-Off Ver
    Microsoft 365 for Enterprise
    Posts
    4

    Re: Using SUM on an IF formula column

    Ah great - thank you! I didn't realise it was to remove the quote marks from only the outcome, not the condition. That's sorted it, thank you.

  8. #8
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,781

    Re: Using SUM on an IF formula column

    B3=IF($A3="D","4", IF($A3="S","2"))+0

    Copy down until last S

    after sum number

    +0 change text in numbers

+ 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] Formula to compare column duplicates in a column & second column with dates
    By lancelotlink in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 01-15-2022, 05:38 PM
  2. Formula to look Column A and Column C and place Desired Outcome in Column E
    By bjnockle in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-20-2021, 11:22 PM
  3. Replies: 7
    Last Post: 11-03-2019, 07:57 PM
  4. [SOLVED] Formula to compare column 1 to column 2 and list items not in column 2.
    By mahalek1976 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-23-2016, 12:55 PM
  5. Replies: 2
    Last Post: 05-21-2015, 10:41 PM
  6. [SOLVED] need formula to this logic, A column number B column blank then C column desired name
    By vengatvj in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 11-02-2013, 10:30 PM
  7. Replies: 2
    Last Post: 08-04-2006, 03:00 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