+ Reply to Thread
Results 1 to 8 of 8

If A5 says "Total", D5 adds D2:D5, otherwise, D5 multiplies with C5

  1. #1
    Registered User
    Join Date
    02-22-2015
    Location
    USA
    MS-Off Ver
    14.4.7
    Posts
    3

    If A5 says "Total", D5 adds D2:D5, otherwise, D5 multiplies with C5

    Thanks in advance for taking the time to help me.
    I am brand new to excel :)

    BWwZPUa.png
    \1

    Currently, this is all D5 (and all of D) does =C5*0.1*-1
    I would like them all to continue to do that unless I have typed Total into corresponding A.
    If I have typed Total into A5, I want it to instead, change it's job and add all the numbers above it, together.


    Hope this makes sense.

    Thanks ^_^
    Last edited by iaMyoU; 02-22-2015 at 05:27 PM. Reason: image didn't show

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,765

    Re: If A5 says "Total", D5 adds D2:D5, otherwise, D5 multiplies with C5

    Some of us can't see image files on this Forum - please attach a sample Excel workbook instead.

    Pete

  3. #3
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: If A5 says "Total", D5 adds D2:D5, otherwise, D5 multiplies with C5

    Quick clarification, are there always 4items above or could Total appear anywhere in Column A? ie could you then have A7:A20 with items and A21 containing Total?
    If someone has helped you then please add to their Reputation

  4. #4
    Registered User
    Join Date
    02-22-2015
    Location
    USA
    MS-Off Ver
    14.4.7
    Posts
    3

    Re: If A5 says "Total", D5 adds D2:D5, otherwise, D5 multiplies with C5

    Here you go Pete, my apologies :)
    example-iaMyoU.xlsx

    [hr]

    Quote Originally Posted by pjwhitfield
    Quick clarification, are there always 4items above or could Total appear anywhere in Column A? ie could you then have A7:A20 with items and A21 containing Total?
    I could type Total anywhere in Column A. As a result, it'll turn blue automatically, and preferably it's corresponding D Column will add all of D instead of doing math with its C.

    Thanks :)

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,765

    Re: If A5 says "Total", D5 adds D2:D5, otherwise, D5 multiplies with C5

    Put this formula in cell D2:

    =IF(A2="Total",SUM(D$1:D1),C2*0.1*-1)

    then copy the formula down.

    Hope this helps.

    Pete

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,765

    Re: If A5 says "Total", D5 adds D2:D5, otherwise, D5 multiplies with C5

    Further to my earlier answer, you should also put this formula in E2:

    =IF(A2="Total",SUM(E$1:E1),C2*0.03*-1+0.3)

    and this one in G2:

    =IF(A2="Total",SUM(C$1:F1),SUM(C2:F2))

    and copy both formulae down.

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    02-22-2015
    Location
    USA
    MS-Off Ver
    14.4.7
    Posts
    3

    Re: If A5 says "Total", D5 adds D2:D5, otherwise, D5 multiplies with C5

    you have no idea how much I appreciate your time. It has saved me possible HOURS or longer of research! I gave you a reputation ^_^
    This question can be closed :)

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,765

    Re: If A5 says "Total", D5 adds D2:D5, otherwise, D5 multiplies with C5

    Well, thanks for feeding back - glad to help.

    Pete

+ 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. Using "Append", adds unwanted double quotes. How to remove them?
    By thelisa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2013, 09:35 AM
  2. [SOLVED] Chart legend adds verbiage "(small team)" at end of data series name
    By jopeters in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 01-16-2013, 10:01 AM
  3. [SOLVED] Macro to delete entire row if cell contains the word "total" or "Total"
    By theatricalveggie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-10-2011, 12:38 PM
  4. Replies: 1
    Last Post: 02-07-2010, 12:44 AM
  5. Linking two "total" pages to create a "Complete Total" page
    By Jordon in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-10-2006, 07:20 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