+ Reply to Thread
Results 1 to 10 of 10

Horizontal Vs. Vertical + Nested formula problems

  1. #1
    Registered User
    Join Date
    01-26-2008
    Posts
    3

    Horizontal Vs. Vertical + Nested formula problems

    I am facing two problems in excel, I hope you can help me with them..

    First: I am trying to reference a very long column of cells A2:A50, to a row (i.e. C1:AY1), so the most left cell in the row=A2, the next =A3, the next =A4 and so on. When I try to drag the formula right it does not seem to want to follow the pattern i.e. advance the number by one in the formula. Can this be done to save me having to do each one manually?


    Second: I have a problem with a formula that shows the result in the insert function dialog

    (The formula is =SUMPRODUCT(A4:A6;TRANSPOSE(C2:E2)))

    But after clicking OK the cell indicate value error WHY?? Please see the attached images for more details.)

    Pic_1.jpg
    Pic_2.jpg

    Thanks very much in advance...
    Last edited by VBA Noob; 01-26-2008 at 03:10 PM.

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    To your second problem try,

    =SUMPRODUCT((A4:A6)*TRANSPOSE(C2:E2))
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    I've had another go at this and got different results???

    Take a look at C6 and D6 and A13, which is what it should be??
    Attached Files Attached Files

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    As to problem one

    In C1 put =INDEX($A$2:$A$50,Columns($C$1:C1),1) and drag right.

    OR

    Select C1:AY1
    Type =TRANSPOSE(A2:A50)
    press Ctrl+Shift+Return (Cmd+Return for Mac)
    Last edited by mikerickson; 01-27-2008 at 01:55 AM.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  5. #5
    Registered User
    Join Date
    01-26-2008
    Posts
    3

    Cool 1st Problem solved ;) Second NOT YET :(

    Thanks mikerickson,

    You solved it !! But could you please explain to me what is happening ?

    oldchippy, I really appreciate your help.

    Regarding the attached file, the result should be as in A13 (but you didn't use transpose in that cell!!)

    I am really annoyed , how Excel shows the answer in the dialog then it returns value error in the sheet

    Hope I will get an answer to that..

    Thanks again to all of you for your kind help

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    In the INDEX formula, the column number is determine the index of the Row returned.
    INDEX(range,column_of_callingCell,1)

    The Transpose; I don't understand array formulas well enough to explain it. It's pretty neat though.

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    You need to use CTRL+SHIFT+ENTER to get the correct result I believe, i.e. try the formula

    =SUM(A4:A6*TRANSPOSE(C2:E2))

    confirmed with CTRL+SHIFT+ENTER.

    To do this, select cell with formula, press F2 then hold down CTRL and SHIFT keys and press ENTER so that curly braces appear around the formula in the formula bar.

    oldchippy:

    The different results you see with SUMPRODUCT are due to the placement of the formula, you get 75 in C6 because it's multiplying the value immediately above (in C2) with each value in A4:A6 and summing the results, For D6 it's the same but D2 used instead of C2

  8. #8
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Thanks daddy,

    I can see now you have spread some light over it! Actually if you Ctrl+Shift+Enter on my formulas it gives the correct answer as well!
    Last edited by oldchippy; 01-27-2008 at 09:49 AM.

  9. #9
    Registered User
    Join Date
    01-26-2008
    Posts
    3

    Wink LOL :) Done it !!

    Cooool

    Thanks daddy,

    Also mine if you Ctrl+Shift+Enter on my formulas (i.e. =SUMPRODUCT(A4:A6;TRANSPOSE(C2:E2)) ) it gives the correct answer as well!

    Thanks oldchippy,daddylonglegs & mikerickson

    I am really happy with your prompt replies and help...

    It is my pleasure to be a member in this forum

  10. #10
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Quote Originally Posted by alnoor
    if you Ctrl+Shift+Enter on my formulas (i.e. =SUMPRODUCT(A4:A6;TRANSPOSE(C2:E2)) ) it gives the correct answer as well!
    Yes that's right

    SUMPRODUCT is often preferable to SUM because it normally means you don't need CSE but here TRANSPOSE needs CSE so probably I'd marginally favour SUM.........however the advantage of using SUMPRODUCT (and ; not *) is that the formula will still work should any of the ranges contain text

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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