I just made an awful formula in excel, which is:
=SUM(A1*C1, A2*C2, A3*C3 ... ... A21*C21)
I was forced to type the 21 elements one by one manually and still have no idea on how to solve the problem despite of long time Google searching...
Is there any elegant way that can solve such situation in more smart manner? ( maybe something like: =SMART_SUM(A1*C1 : A21*C21) )
thanks for your attention!
This is a typical use case for SUMPRODUCT
=SUMPRODUCT(A1:A21,C1:C21)
Related
This might be a simple fix I'm unsure. I have the following formula which I would like to be able to drag up and down =IF(C311>B311,IF(C310>B310,IF(B309>C309,IF(C312>B312,2,1),0),0),0)
I'm guessing AND can be implemented in some way but I'm not sure. The logic behind my goal is if C311>B311 AND C310>B310 AND B309>C309 then check to see if C312>B312 if it is then put a 2 else put a 1. Perhaps there is another solution as well I'm not thinking of.
Try this: =IF(AND(C311>B311,C310>B310,B309>C309),IF(C312>B312,2,1),"")
Last argument I left it as "" but replace it to whatever you need.
Just another approach-
=IF((C311>B311)*(C310>B310)*(B309>C309),IF(C312>B312,2,1),"")
I am working on a project in Python, and I stumbled across this hindrance.
I have something like this:
[['abcde'],['bcdef']]
How do I make it such that it gives me this? :
[['a','b','c','d','e'],['b','c','d','e','f']]
Thank you for helping
It would be better if you start reading docs
[list(string) for string in given_list]
or otherwise
list(map(list,given_list))
I am trying to build an IF formula but I am getting an error that I have too many arguments. Any idea how to fix this?
=IF(BZ190=$C$163,$C$163, IF(BZ190=$C$163*$C$165,$C$163*$C$166, IF(BZ190=$C$163*$C$166,$C$163*$C$167, IF(BZ190=$C$163*$C$167,Z190=$C$163*$C$168, IF(BZ190=$C$163*$C$168,$C$163*$C$169, IF(BZ190=$C$163*$C$169,$C$163*$C$170, IF(BZ190=$C$163*$C$170,$C$163*$C$171, IF(BZ190=$C$163*$C$171,$C$163*$C$172, IF(BZ190=$C$163*$C$172,$C$163*$C$173, IF(BZ190=$C$163*$C$173,$C$163*$C$174, IF(BZ190=$C$163*$C$174,$C$163*$C$175, IF(BZ190=$C$163*$C$175,$C$163), IF(AND((SUM(BZ190:BZ$190)-CA$168)<0,BZ190=""),$C$163*$C$165,"")))))))))))
The last but one if-clause looks like this:
IF(BZ190=$C$163*$C$175,$C$163),
^
|
| bracket is obsolete
There should not be a bracket at the end, it should just be:
IF(BZ190=$C$163*$C$175,$C$163,
But I have another point here: imagine that, within half a year or within a year, you need to modify something. How will you find out what all those things mean? Therefore I'd advise you to use names, something like:
$C$163 equals "interest_rate"
$C$165 equals "student_income"
...
Like this, your formula will become something like:
IF(BZ190=interest_rate,interest_rate,
IF(BZ190=interest_rate * student_income, ...
This will be much clearer to read and to maintain. And, oh, before I forget: writing the formula in multiline (one if-clause per line) also increases readability and maintainability.
Here is my statement with just one IF Statement:
=IF(AF2="Consultant",IF(C2=INDEX(JIRA!F:F,MATCH('RFO Checks'!M2,JIRA!A:A,0)),1,0),"N/A")
This works great, but now I need to add two more IF Statements.
AF2 will either contain "Consultant", "Retailer", or "PC".
Each one will be directed to a different price column:
for "Consultant" it's JIRA!F:F
for "Retailer" it's JIRA!D:D
for "PC", it's JIRA!E:E.
I've been wracking my brain for two days now and haven't gotten no where.
Suggestions?
Thank you in advance!
Use CHOOSE()
=IFERROR(--(C2=INDEX(CHOOSE(MATCH(AF2,{"Consultant", "Retailer", "PC"},0),JIRA!F:F,JIRA!D:D,JIRA!E:E),MATCH('RFO Checks'!M2,JIRA!A:A,0))),"N/A")
Aaron,
I have provided you the high level structure for the change of logic.
If this is what you want, then you can substitute the phrases with the appropriate logic.
=IF(AF2="Consultant",
IF(C2=INDEX(JIRA!F:F,MATCH('RFO Checks'!M2,JIRA!A:A,0)),1,0),
IF(AF2="Retailer",
<insert_logic_for_retailer>,
IF(AF2="PC",<insert_logic_for_PC>,"N/A")
)
)
Logic for Consultant -
IF(C2=INDEX(JIRA!F:F,MATCH('RFO Checks'!M2,JIRA!A:A,0)),1,0)
Logic for Retailer, use this to replace -
IF(C2=INDEX(JIRA!D:D,MATCH('RFO Checks'!M2,JIRA!A:A,0)),1,0)
Logic for PC, use this to replace -
IF(C2=INDEX(JIRA!E:E,MATCH('RFO Checks'!M2,JIRA!A:A,0)),1,0)
Let me know in case you still have any issues!
I have a probleem in excel and i didnt figure it out how to do it right. anyway i'll give you an example to explain it correctly.
Name Surname Code
Martin Kara Maar4 (=> First two letters from Martin and 2nd en 3rd letters from surname and code is 4 and that's the lenght of the surname.
the probleem is i wanted to see the Maar4 as Maar04 not as Maar4.
I have already checked the formatcell but still didnt find it.
this is the code i wrote it:
=UPPER(LEFT(A2;2)& MID(B2;2;2)&LEN(B2))
thank you
edit: problem is solved. you guys are amazing. thank you
I'm not sure why you're using UPPER() if you expect Maar04. If you do want to get Marr04, you would use:
=LEFT(A2;2)&MID(B2;2;2)&TEXT(LEN(B2);"00")
If you want to get MAAR04, then you'd use the uppercase:
=UPPER(LEFT(A2;2)&MID(B2;2;2)&TEXT(LEN(B2);"00"))
Try using TEXT function to force 2 digits
=UPPER(LEFT(A2;2)& MID(B2;2;2))&TEXT(LEN(B2);"00")
If you're quite sure the length will never go above 99 you can try this hack:
=UPPER(LEFT(A2;2)& MID(B2;2;2)&RIGHT(LEN(B2)+100,2))
Need to use REPT() to achieve this.
See: http://office.microsoft.com/en-us/excel-help/rept-HP005209236.aspx
Your formula MIGHT look somehing like this;
=UPPER(LEFT(A2;2)& MID(B2;2;2)&REPT(0,LEN(B2)))