I'm at my wits end trying to troubleshoot COUNTIF
I see there are three instances of 11.0.6000.0162 but =COUNTIF(A1:A8559,B1) doesn't believe this.
And I evaluated the cells
=A1=B7 = TRUE
=A2=B7 = TRUE
=A5=B7 = TRUE
I have been trying to run larger figures and now I know why the numbers don't quite add up .... Thanks!
UPDATE
Here is new set of data. I thought =COUNTIF($A$1:$A$20,B1) would work, but I'm still having problems
Assuming column A contains all your data, B contains the certain numbers you wish to count and C1 is where you will post the formula
=COUNTIF(A:A,B1)
will work if you write the number in B1 in exactly the same format as it would be in the list.
You could then drag the formula down from C1 as far as needed.
Related
I currently have a large nested IF statement that uses a helper cell (C1) to dictate which formula to utilize based on numbers 1,2,3,5 & 6. Specifically, one IF statement within the larger nested IF statement needs to be updated for instances when there is a blank cell in column A. Here is how my workbook is setup:
Data Tab
Bonus Tab
Summary Tab
This is my current formula in Column B:
=IF(Data!$C$1=2,IF(SUM(Bonus!B2:C2)<1,0,1)*Data!$B$3+Data!$B$2)
What I am looking for is when cells in column A are blank, than the corresponding cell in Column B would be 0. Again, the formula above has to remain in the =IF(Data!$C$1=2, format since it is part of a larger nested IF statement.
Answer I am seeking:
Thank you for looking!
Try this:
=IF(Summary!A2="",0,IF(Data!$C$1=2,IF(SUM(Bonus!B2:C2)<1,0,1)*Data!$B$3+Data!$B$2))
How about adding an IF in there like this?
=IF(Data!$C$1=2,
IF(LEN(Summary!A2)>0,1,0)*
(IF(SUM(Bonus!B2:C2)<1,0,1)*Data!$B$3 + Data!$B$2))
or like this
=IF(Data!$C$1=2,
IF(LEN(Summary!A2)>0,
IF(SUM(Bonus!B2:C2)<1,0,1)*Data!$B$3 + Data!$B$,
0))
What about:
=IF(AND($C$1=2,LEN(A2)>0),IF(SUM(Bonus!B2:C2)<1,0,1)*Data!$B$3+Data!$B$2)
I realise this gives you FALSE rather than 0 at the end, but I don't know what the rest of your 7 IF statements look like.
EDIT
Based on #AlexisOlson 's comment:
=1*IF(AND($C$1=2,LEN(A2)>0),IF(SUM(Bonus!B2:C2)<1,0,1)*Data!$B$3+Data!$B$2)
This now returns 0 when Column A is blank, as required.
I am trying to write an if statement which excel returns value.
Here is the example
I wanted to sum a range of rows say A1:A25 and if the value of sum B1:b25 is less than A1:A25 return condition true, if not perform calculation.
=IF(G7:AT7>G8:AQ8,0,"-0.1*(SUM(Y14:AL14))+SUM(AO14:AQ14")
Above was my condition but the excel returns "Value"
Can any one here assist how to fix this formula?
You have several syntax errors.The formula should be:
= IF(SUM(B1:B25) < SUM(A1:A25) , true , -0.1 * (SUM(Y14:AL14) + SUM(AO14:AQ14)))
You use different Ranges in Text and Formular. Make it match.
You need to calculate sums before you can compare. It may be easier in the beginning if you just do things step by step in other cells.
According to text it should be:
=IF(SUM(B1:B25)>SUM(A1:A25);TRUE();"other calculation")
more oversight you get by first doing sums in different cells…
[C1]=SUM(A1:A25)
[D1]=SUM(B1:B25)
[E1]=-0.1*SUM(Y14:AL14;AO14:AQ14)
[F1]=IF(D1<C1,TRUE(),E1)
after everythings works as you liek it, you can still merge, clean up and make it look nice.
At first thanks to answer)) (It's important for me :p )
I have a number in A3.
When there is this number in column A (Sheet1), per exemple A7 then it will take the value of the cell B7.
=SOMMEPROD(('Sheet1'!A3:A34=Sheet1!A3)*('Sheet1'!B3:B34))
I use SOMMEPROD, it's working but only with number, and sometimes I have text and number in my cell (column B).
I already changed the format of the cell but doesn't work.
Thanks a lot)))
I think you are saying that some of the values in column B are expressed as text, not as a number, probably because they were imported from another source.
if that is the case: First, convert column B into numbers, Then, use sumproduct.
For example, FIRST convert text to values:
in C3 you would enter
=value(b3)
Then copy that down to from C3 to C34.
Then
=SOMMEPROD(('Sheet1'!A3:A34=Sheet1!A3)*('Sheet1'!C3:C34))
should have the desired effect.
Note that you sometime get #N/A errors with the "value" function, for example if there are unexpected spaces. To be safe, rather than using value alone, try this:
= iferror(value(B3),0)
or to be more creative you can try:
= iferror(value(substitute(B3," ","")),0) ' deletes all spaces
= iferror(value(substitute(substitute(b3,char(160),"")," ","")),0)
'deletes all spaces and "nonbreaking spaces" copied from a web page
It depends on what you're trying to use SumProduct for. There's two main reasons this function shows up. Those are:
To sum the product of two ranges.
To sum a range of numbers that meet multiple criteria. This relies on that True = 1 and False = 0 so when want to find the combined weight of blue dogs in some cells, your formula might look like =SUMPRODUCT(1*($A$1:$A$50 = "Blue"), 1*($B$1:$B$50 = "Dog"), $C$1:$C$50). Note the 1* which guarantees the formula will know how to multiply the results. After all, True and False don't multiply. Their binary representations (1 and 0) though, do.
NB though that people also sometimes remember it as a lookup formula because of the second use, and therefore expect to be able to get text back. Such approaches are an easy misunderstanding to end up with, but really there you want to use an INDEX(<Result Array>,MATCH(1,INDEX(1 * (FIRST CONDITION) * (SECOND CONDITION) * (AND SO ON),,),0). This approach basically gives you an array formula without CTRL-SHIFT-ENTER (it's not faster, but because the condition is in an index formula, it works), and your conditions can be arbitrary (the same way as for sumproduct). But it'll give you the FIRST result, not the sum of all of them.
Hope that helps.
Edit: Crossed my mind, you might be expecting A1 to contain Erp and B1 to contain 54, and in C1 you want Erp54. This doesn't even need a function - just the & operator, which joins two strings together - so in C1, you'd just put =A1 & B1. And you're done.
I need to sum the vehicle and max hr intersection set for each subsystem. In other words I need to sum value of TRUEs and print the sum in the 1st FALSE which is above these TRUEs.
For example:
D1 = B2
D3 = B4+B5+B6+B7
D8 = B9+B10+B11
This is a simplified version of my real requirement. There exist thousands of data in my file. I don't know VBA. I also don't know which functions to use in this case, if it's possible to solve this without VBA.
which function(s) should I try?
regards.
You can use something like that:
=IF(C1=FALSE;SUM(B2:B11)-SUM(D2:D11);"")
It sum ALL the number and subtract all the othr sum below...
Copy and paste for every cells. Make attention to NOT fix the cell ($) otherwise don't work...
It's NOT a very good solution, but work.
I'm relatively new to excel programming. I'm working on making a spread sheet that shows exponential decay. I have one column (A1:A1000) of 1000 random numbers between 1 & 10 using the TRUNC(RAND()*10,0) in each cell. The next Column (B1:B1000) has a logic mask =IF(A1=0,1,0) , where if the value in the A cell is 0, then the B cell shows a 1. Next, to find the number of 0's in the A column, I have the next column taking the sum of B1:B1000, which returns the number of 0's that showed up in the first column. I'm sure there's an easier way to do that, but this seems to work fine.
Here's my problem, hopefully it's clear what I'm asking:
Next, I want to take the sum of the logic column (B) from B1:B(1000- the value of the sum from (B1:1000)) in the cell below the cell that calculates sum(B1:B1000). Is there a way to to algebra in a cell formula to reference a cell? More simply, if I want to refer to A3, for example, is there a way to input something like A(2+1) to get A3? Does this make sense?
You can very easily do, in VBA:
ActiveCell.Formula = "=A" & (2+1) & "+15"
In Excel:
=INDIRECT(ADDRESS(2+1, COLUMN(A1)))+15
This will set the formula to "=A3+15". Generally, this is best done with variables, so remember to do that.
In Excel, and as pointed out by Eric, you can write the referance to the cells just like normal strings thanks to INDIRECT() function.
Just make sure that the string passed to INDIRECT() is a valid cell reference.
For example :
=SUM(INDIRECT("B" & 2+7*(H2-1)):INDIRECT("B"&(2+7*H2)-1))
Here, I sum 7 lines for each week (H2). It gives the sum of B2:B8, B9:B15, B16:B22, etc.
Hope my example will help you figure out how to use it in real situation.