+ Reply to Thread
Results 1 to 8 of 8

Function for cell ranges and add cell*

  1. #1
    Registered User
    Join Date
    04-28-2020
    Location
    Ireland
    MS-Off Ver
    2019
    Posts
    7

    Function for cell ranges and add cell*

    Hey,

    I have a function where I display data from cells H7 to H13 as below:

    =SUM('Trade Data'!H7:H13)

    I want to also include data from other cells, for example H16 and H19, I cannot enter !H7:H19 as it would include H17 and 18 also which I do not want displayed.

    Any help would be appreciated, thanks

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Function for cell ranges and add cell*

    How about
    =SUM('Trade Data'!H7:H13,'Trade Data'!H16,'Trade Data'!H19)

  3. #3
    Registered User
    Join Date
    04-28-2020
    Location
    Ireland
    MS-Off Ver
    2019
    Posts
    7

    Re: Function for cell ranges and add cell*

    Quote Originally Posted by Fluff13 View Post
    How about
    =SUM('Trade Data'!H7:H13,'Trade Data'!H16,'Trade Data'!H19)
    That works thank you, I have another small issue. I have another function that reads:

    =AVERAGEIF('Trade Data'!Q7:Q13,"<0")

    Unfortunately the fix does not work here, perhaps because there is alreay an , used here?

    thanks

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Function for cell ranges and add cell*

    You cannot do that with the averageif function, it needs a single range.

  5. #5
    Registered User
    Join Date
    04-28-2020
    Location
    Ireland
    MS-Off Ver
    2019
    Posts
    7

    Re: Function for cell ranges and add cell*

    Quote Originally Posted by Fluff13 View Post
    You cannot do that with the averageif function, it needs a single range.
    Is there a way of expressing it as say; H7 + H8 + H9 + H15 etc?

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Function for cell ranges and add cell*

    Not using th averageif function, no.
    Will there be negative values in between Q13 & Q19?

  7. #7
    Registered User
    Join Date
    04-28-2020
    Location
    Ireland
    MS-Off Ver
    2019
    Posts
    7

    Re: Function for cell ranges and add cell*

    Quote Originally Posted by Fluff13 View Post
    Not using th averageif function, no.
    Will there be negative values in between Q13 & Q19?
    Yes there will likely be negative values also in most cases

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Function for cell ranges and add cell*

    Not very elegant, but try
    =(SUMIF(Q7:Q13,"<0")+IF(Q16<0,Q16)+IF(Q19<0,Q19))/(COUNTIF(Q7:Q13,"<0")+(Q16<0)+(Q19<0))

+ 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] cell a function doing math on previous sheet, cell b - cell c result in cell d...
    By dad812 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-08-2018, 08:20 AM
  2. Determine address of cell range and dimension of the cell ranges
    By jamie+ in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-23-2018, 01:30 AM
  3. [SOLVED] Changed Text Displayed In One Cell Based On Multiple Ranges In Another Cell
    By Frogkase in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-29-2017, 03:36 AM
  4. [SOLVED] Match with cell ranges as cell content - non-volatile formula required
    By B.W.B. in forum Excel Formulas & Functions
    Replies: 42
    Last Post: 07-24-2017, 04:51 AM
  5. [SOLVED] Use 2 Different Named Cell Ranges To Return Values From 1 Of the Ranges In Formula
    By DESSTRO in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-20-2017, 08:37 PM
  6. Change Cell color based on different cell value and three date ranges
    By Erkden in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-18-2013, 11:13 PM
  7. [SOLVED] Looping through cell ranges in multiple worksheets and prevent saving if cell value empty
    By Spritz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-22-2013, 11:24 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