Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have two table with figures with dimension 9*9. I would like to compute
sum(aij*bij) over j
with obvious notation with one formula only.
For now, I am first computing a 9*9 table filled with aij*bij in each cell, and then in a new column I am doing a sum over columns of values in this 9*9 table. It is two step. I would like to do that in one step to save space and time.
What is syntax ?
Thanks
You should be able to use SUMPRODUCT formulas to sum products over columns.
If your original arrays are in ranges A1:I9 and K1:S9, then the first entry in your result array would be =SUMPRODUCT(A1:I1, K1:S1). Copying this formula down for eight rows more gives you the rest of the result elements..
Summing the products over all elements would be even easier: SUMPRODUCT(A1:I9,K1:S9)
Another approach here - use array SUM formula: =SUM(A1:I1*K1:S1). However, as you type it into cell, press CTRL+SHIFT+ENTER instead of usual ENTER. As a result, this formula will be displayed as {=SUM(A1:I1*K1:S1)} - brackets indicate that this is an array formula. However, they should NOT be manually added.
#chuff answer is absolutely correct and I upvoted it, but using array formulas has at least 1 advantage: with them you may do much more magic tricks which are not / hardly implemented using SUMPRODUCT or any similar functions.
Please also see Remark section there: http://office.microsoft.com/en-001/excel-help/sumproduct-HP005209293.aspx
Use this sample file as a demo for both solutions: https://www.dropbox.com/s/0xr8iif920uqpqf/SUMPRODUCT.xlsx
Choose any solution which is more suitable for you! (:
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed last month.
Improve this question
I know we can easily convert or change the attribute to of data in a cell quickly and there are shortcuts for it but is there a way to check if a data or list of data in a column is saved as an int/string/date/etc?
I would like to be able to just quickly check if the data I have in a column is saved in the correct format/attribute without having to convert/change it again just to make sure.
Excel will make assumptions of what the data is automatically. There is no datatype like in python or other coding languages. There are functions for testing cells values.
Functions to look at istext(), isblank(), isnumber(), islogical(), iserr(), ...
so if you want to know the data type in B5.
=IFS(ISTEXT(B5),"String",ISBLANK(B5),"Null",ISNUMBER(B5),"Number",ISLOGICAL(B5),"Boolean",ISERR(B5),"Error")
To convert a number to a string use the single quote mark prior to the number like '50. A date in excel is also a number. To convert a number stored as a string into a number multiply by 1.
Edit---
There is a fuction =Cell() see the details here
=CELL("format",B5)
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 9 months ago.
Improve this question
I'd like make a task for my work way more simple, but in pretty lost since I'm just starting to learn VBA.
What I wanna make easier is a process of removing certaing data from an excel sheet.
Please, see the image, I think it's easier to understand.
I'd like to ask for an input of a market in column P. Let's say the user enters "Portugal". Then it would look for the rows that have that value in column P and delete the ones that doesn't contain information for Portugal (e.g. it would delete rows from 6 to 9 and 21 to 25, but rows 2-5 and 10-20 should not be deleted).
Any good ideas? I think it should be simple somehow but I can't think of any solution.
Thanks
Let me teach you some Excel magic:
Select the entire column "P".
Press Ctrl+G , choose "Special" and then "Blanks".
Click in the address bar and type =P2.
Press Ctrl+ENTER (don't forget the Ctrl button!)
This should fill in the "P" column as you desire and from then on, you can use the basic autofilter.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have a large amount of data that was converted to excel recently.
There are just two columns and more than 100000 lines. There is an Image as an example attached here.
The systems are always in the second columns as well as the data, but the loads and the rest of the information are in the first column, as you can see in the example, the "Max load" always repeat, but in the system 001 there is a difference of two lines between it and the system name, but in the second system the difference is three lines. I want to make a table for Max load with all the systems, those are the things I tried:
I used MATCH to find the line where the System name appears, knowing that the difference would be either 2 or 3 lines, I made a table with 2 and 3 in the header and I added it to the line I found and MATCH, it kind of work, but I wanted something better than this improvisation.
I also tried using (where X2= the line where the system name appears)
=MATCH(AA1;OFFSET(A1:X2:0:100:1);0)
Because I thought that OFFSET would return a range to MATCH, but it didn't work.
I want to know if there is a way to find the text "Max load" after the line I found using the Systems' names in MATCH. Basically, I want to know if there is a way of using kind of a "dynamic array" inside MATCH, so I would use it to find "Max load" right after the system that I am looking for.
I don't if this works, but if there is any other way of doing it, I am glad to know about it.
Thanks very much,
Matheus
You can use multiple match with index. Use below formula. It will not care how many rows are different from system to data.
=INDEX(D:D,MATCH(H4,D:D,0)+MATCH("Max Load",INDIRECT("C" & MATCH(H4,D:D,0) & ":C200000"),0)-1)
I think you are overthinking this way too much. If you just have either two or three rows, if offsetting the answer by 1 gives you 0 then use a simple if statement to offset it by 3.
=IF(INDEX(E:E,MATCH(H3,E:E,0)+2)>0,INDEX(E:E,MATCH(H3,E:E,0)+2),INDEX(E:E,MATCH(H3,E:E,0)+3))
Another option
In I4, formula copied right to J4 and all copied down :
=INDEX($D:$D,AGGREGATE(15,6,ROW($C$6:$C$1000)/($C$6:$C$1000=I$3),ROW($A1)))
Another solution would be
=INDEX(INDEX($D:$D,MATCH($F4,$D:$D,0)):$D$200000,MATCH(G$3,INDEX($C:$C,MATCH($F4,$D:$D,0)):$C$200000,0))
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I'm asking if it's possible in excel to write a formula that
takes a cell value and get 10 values from right to left (in order to remove unwanted values as for example +58, 58, 0)
and then get the first three values in order to remove unwanted once again
For example, see the sample data below:
04145885607
04145894589
04145920307
04145930676
04145945235
04145971623
584146316092
+584146317534
00584146318088
4146337864
4146361075
4146400205
4146415696
4146416643
I need to remove in first values like +58, 58, 0 all at the start of the string
then compare the first three values and leave for example those who have 414 or 424
Is that possible in Excel?
Try
=MID(A1,FIND("414",A1),99)
Or with 424 in the mix
=MID(A1,IF(ISERROR(FIND("414",A1)),FIND("424",A1),FIND("414",A1)),99)
UPDATED
Here is a slightly more complicated formula that will work if you have both "414" and "424" mixed in the column of text strings. Note that the FIND function will also work in place of the SEARCH function in the formula.
=MID(A1,IFERROR(SEARCH("414",A1),0)+IFERROR(SEARCH("424",A1),0),99)
Another variation that will work as well:
=MID(A1,IFERROR(SEARCH("414",A1),IFERROR(SEARCH("424",A1),0)),99)
An interesting alternative that works if you have a list of values that could be a match is the following array formula:
=MID(A1,MIN(IFERROR(SEARCH($D$1:$D$3,A1),99)),99)
To use it, you set up a list of the values to look for (I used cells D1:D3 as shown below) and then reference that list in the SEARCH (or FIND) function. As an array formula, it needs to be entered with the Control-Shift-Enter key combination.
All of these formulas return a #VALUE! error if the search strings are not found.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Far too often, I've got a formula that wraps functions inside of functions inside of functions, and when some new condition requires that I wrap another function around it, I often find myself completely losing track of which parentheses go where, which function applies to which set of parameters and usually find myself debugging a statement for a half hour after my modification produces unexpected results.
What I've BEEN doing is to cut the function into its individual parts in a column...each row representing a single function, and when I'm satisfied that end result is what it needs to be, I copy each piece back into it's respective spot in the preceding cell until I have a completed, and hopefully working, function.
CONSIDER:
=IF((ISERROR((VLOOKUP(D2,$A$2:$A9,1,0))),(IF((D2=(VLOOKUP(D2,$A$2:$A$9,1,0))),0,D2)),E2)
0 =IF((ISERROR((VLOOKUP(D2,$A$2:$A9,1,0))),L17,E2)
TRUE =ISERROR((VLOOKUP(D2,$A$2:$A9,1,0))
0 =IF((D2=L18),0,D2)
the =VLOOKUP(D2,$A$2:$A$9,1,0)
It'd be great to be able to document inline or have something similar to a VBA popup ion which to edit formulae, but since that doesn't exist, I'd be interested to know what other techniques for effectively building complex functions you've found helpful. Thoughts?
Normally, I split formulas over multiple columns - each column then contains a part of the formula. I never stuck them into a single cell - while "cleaner" they are impossible to debug.
If the columns are to much, I build a "admin" sheet, which can be hidden.
I dislike the excel formula editor in general - while I really like the power of the formulas, the editor is a pain to use.