+ Reply to Thread
Results 1 to 15 of 15

Formula in cells

  1. #1
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Formula in cells

    Hi,
    I was trying to get a formula that will show zero until I placed the number in the J3 cells. That something like this =IF(SUM(C9:G9)=0,"",SUM(C9:G9))

    I want to accomplish something like this. Example: There is a column of $2 and $4. If I put 2 in column $2 then the total up should be 4 and if I put 2 in the $4 column then that should be the total of $8.00.

    The sample example worksheet. The total should be $20 under the balance. Because there is 2 of ($2 columns) and 4 ($4 columns).

    Thank you in advance.
    Attached Files Attached Files

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Formula in cells

    Try this.

    =IF(COUNT(B3:I3), SUMPRODUCT($B$2:$I$2,B3:I3), "")
    If posting code please use code tags, see here.

  3. #3
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Formula in cells

    =sumproduct((b3:i3*$b$2:$i$2))
    Attached Files Attached Files
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  4. #4
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Formula in cells

    Hi Etaf

    How did you get this { } after you enter the formula?

    thanks.

  5. #5
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Formula in cells

    it should not need an array , thats what the {} shows , but my version of excel 365 now decides itself , whereas before it would need entering

    previous version you would use
    (Ctrl + Shift + Enter)
    in the formula bar
    to get the } brackets

  6. #6
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Formula in cells

    Etaf,
    It worked! Yay!

    Request, can you make the cell J3 Balance not visible until I enter the item?

    Thanks.

  7. #7
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Formula in cells

    as posted by Norie

    =IF(COUNTA(B3:I3),SUMPRODUCT((B3:I3),($B$2:$I$2)),"")
    Attached Files Attached Files
    Last edited by etaf; 01-13-2021 at 03:59 PM.

  8. #8
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Formula in cells

    Hi Etaf,
    I don't what happened. I change $2 to 2 oz but I get the #value Result.

    I only put the $2 and $4 as a title as a sample but when I changed it it difers the result.

    Sorry, The original is actually 2 oz and 4 oz.

    thanks.
    Attached Files Attached Files

  9. #9
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Formula in cells

    the 2 was a number , formatted with a $
    BUT now you have TEXT with the OZ, so will NOT work

    Maybe able to extract just the first character , assuming its always going to be 1 character

  10. #10
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Formula in cells

    try
    =SUMPRODUCT(B3:I3*LEFT($B$2:$I$2,1))
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Formula in cells

    It worked!

    Thank you Etaf.

    and Thank you Norie.

  12. #12
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Formula in cells

    you are welcome

  13. #13
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Formula in cells

    Hi etaf,
    Sorry, there's a change.

    Please Login or Register  to view this content.
    2 oz is going to be $4.00 and the 4 oz is going to $8.00

    How do I change the formula?

    Thanks.

  14. #14
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Formula in cells

    You seem to have changed some other things too, for example the row the cost per unit is coming from.

    In the original workbook that was row 3, now it looks like you are using row 1.

    Can you upload a new workbook?

  15. #15
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Formula in cells

    Hi,
    I think I got it. Thank you Norie and thank you all.

+ 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] Simple formula needed to count cells based on item names in other cells
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-25-2019, 05:49 PM
  2. [SOLVED] Formula to return N for cells with 0 and empty cells, and Y for cells with data
    By stpeter in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-13-2016, 05:20 PM
  3. Formula checks multiple cells for words and outputs answer depending on cells
    By keez1993 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-15-2015, 09:18 AM
  4. Replies: 3
    Last Post: 07-26-2014, 06:12 AM
  5. Formula needed for dividing 2 sets of cells and excluding adjacent text cells
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-07-2013, 06:45 PM
  6. Replies: 1
    Last Post: 11-20-2012, 10:08 AM
  7. Formula: Drop Down List -> Choose Option Finds Cells & Replace Cells with Cells
    By g00glethis1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-14-2010, 01:10 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