Archive for the ‘if statement’ Category

Replace hard code with variable in Excel If statement using VBA?

August 13, 2011 - 12:40 am 1 Comment

Hard coded, the VBA code looks like this:
Range(formulaString).Select
ActiveCell.FormulaR1C1 = _
"=IF(Data!R[-58]C1=""yes"", ""duplicate"" ,Data!R[-58]C[+1])"
Range(rangeStr).Select

I want to change to the following:
"=IF(Data!R[variable]C1=""yes"", ""duplicate"", Data!R[variable]C[+1])"

I tried making variable = "-" &ltrim(str(58)), but that still creates an error.

What am I doing wrong?

R[variable] should be R[" & variable & "]

What is one true statement about yourself and one false statement?

August 8, 2011 - 1:01 am 16 Comments

mix them up. don’t tell which

Then… people vote on whether A is true (thumbs up) or B is true (thumbs down)

then…if you feel like coming back later tonight or tomorrow to let us know which is true, by all means, please do.

I totally *STOLE* this idea from another section, but I thought it would be fun for R&S.
I’m talking about trivial stuff.

A: I never shut up about Religion and Philosophy and drive my wife insane!!!

B: I let my wife answer this question

What is a good thesis statement and outline structure for a research paper on the death penalty?

August 5, 2011 - 8:46 am 3 Comments

In my English class we have to write a research paper 2500 to 3000 words so like 10-12 pages on whatever topic. I chose the Death Penalty. I need help on how my outline should look like and a good thesis statement. I am against the death penalty. I feel that is should be abolished if that helps any. Could anyone help me please?

The best place to start is at In the meantime, http://www.deathpenaltyinfo.org/student-resource-center
Click on ideas for research papers and debates.

In the meantime, I hope this will help you:

For the worst crimes, life without parole is better, for many reasons. I’m against the death penalty not because of sympathy for criminals but because it isn’t effective in reducing crime, prolongs the anguish of families of murder victims, costs a whole lot more than life in prison, and, worst of all, risks executions of innocent people.

The worst thing about it. Errors:
The system can make tragic mistakes. In 2004, the state of Texas executed Cameron Todd Willingham for starting the fire that killed his children. The Texas Forensic Science Commission found that the arson testimony that led to his conviction was based on flawed science. As of today, 138 wrongly convicted people on death row have been exonerated. DNA is rarely available in homicides, often irrelevant (as in Willingham’s case) and can’t guarantee we won’t execute innocent people. Capital juries are dominated by people who favor the death penalty and are more likely to vote to convict.

Keeping killers off the streets for good:
Life without parole, on the books in most states, also prevents reoffending. It means what it says, and spending the rest of your life locked up, knowing you’ll never be free, is no picnic. Two big advantages:
-an innocent person serving life can be released from prison
-life without parole costs less than the death penalty

Costs, a surprise to many people:
Study after study has found that the death penalty is much more expensive than life in prison. Since the stakes are so high, the process is far more complex than for any other kind of criminal case. The largest costs come at the pre-trial and trial stages. The tremendous expenses in a death penalty case apply whether or not the defendant is convicted, let alone sentenced to death. The tremendous expenses in a death penalty case apply whether or not the defendant is convicted, let alone sentenced to death.

Crime reduction (deterrence):
The death penalty doesn’t keep us safer. Homicide rates for states that use the death penalty are consistently higher than for those that don’t. The most recent FBI data confirms this. For people who lack a conscience, fear of being caught is the best deterrent.

Who gets it:
Contrary to popular belief, the death penalty isn’t reserved for the worst crimes, but for defendants with the worst lawyers. It doesn’t apply to people with money. Practically everyone sentenced to death had to rely on an overworked public defender. How many people with money have been executed??

Victims:
People assume that families of murder victims want the death penalty imposed. It isn’t necessarily so. Some are against it on moral grounds. But even families who have supported the death penalty in principle have testified to the protracted and unavoidable damage that the death penalty process does to families like theirs and that life without parole is an appropriate alternative.

It comes down to whether we should keep a system for the sake of retribution or revenge even though it isn’t effective in reducing violent crime, costs much more than alternatives and, worst of all, can lead to the nightmare of executing someone for a crime he didn’t commit.

Classify the statement as always, sometimes, or never true…… If a > b, then a/c > b/c .?

August 1, 2011 - 7:08 pm 3 Comments

Which sentence is best represented by the inequality ¼ m ≤ 8
a.One fourth of a number is at most 8.
b. Four times a number is less than or equal to 8.
c. One fourth of a number is greater than or equal to 8.
d. Four times a number is no more than 8.

2. Which sentence is best represented by the inequality 8x ≥ 9
a.The product of a number and 8 is at least 9.
b. 8 times the number is greater than 9.
c. The quotient of a number and 8 is greater than or equal to 9.
d. The sum of 8 and a number is at most 9.
Thankyou for you help . ^____<3

(1) Recall that if you divide or multiply both sides of an equality by a negative number, then you must switch the signs.

Since a/c > b/c is just a > b but with both sides divided by c, we see that this is sometimes true because a > b only implies a/c > b/c if c is positive; otherwise if c is negative, then a/c < b/c due to the sign flip.

(2) Note that the left side is one-fourth times m. If we say that m is the number, then this becomes "one-fourth times a number" or "one-fourth of a number" (remember that "of" means multiplication). Coupling this with the fact that ≤ means "equal to or less than," which also implies that it means "at most," this is "one-fourth of a number is at most 8," which is option (a).

(3) Again, call x this number. 8x either means "eight times x" or "the product of eight and x." ≥ means "EQUAL TO or greater than" (don’t be tricked into thinking that (b) is the answer) or "is at LEAST," so 8x ≥ 9 is "the product of a number and 8 is at least 9," or (a).

I hope this helps!

By making an impartially (racist) statement about Obama, could McCain be prosecuted (if it is proven that th

July 28, 2011 - 3:52 pm 21 Comments

McCain has been quoted as saying that Obama (and the rest of America) "should be proud of where he is" <–obviously as in proud to be a contender for the presidency (being African American). Clearly McCain was attempting to present his statement as a compliment to Obama, and I am sure most of you probably did not even think anything of it. But whether or not it was actually intended as such, and I believe it was because McCain would have never said it otherwise, this was truly a racist statement. For instance, why should Obama have to be "proud of where he is"? Because he is black? What if he was white? This statement would have never been made. In fact, what if everyone looked exactly the same and had the same skin tone? Then no one would be able to discriminate. Yet other than appearances and learned behavior, all humans ARE in fact exactly the same, as in the same species. So how can there even be racism? Anyhow, I guess my question is, has this ever even been looked into, and could McCain possibly be prosecuted for making this statement?

Well has there ever been a African american presidential nominee.
If he was white of course it wouldnt be big because all our presidents in the past were white males.
But he made history by being a nominee and possibly the next president.
Of course he and america should be proud.
Many peple said he wouldnt make it far because he was African American but he did.
So I dont see how anyone would get angry by this remark.

Do you agree with the statement: If you can’t answer "why?", then your argument is invalid?

July 24, 2011 - 11:15 pm 9 Comments


Yes, where is the argument if you dont know the details behind it.
Better yet, where is the argument if you dont know why you are arguing for it? or against it?
The whole world is built on why’s.

If someone was debating whether the world was going to end in 2012 or not, you cant argue saying it will, if you have no evidence of it.

Although you can argue based on your beliefs.

If you were a stripper, how will this statement from someone affect you: "You’re better than this!"?

July 21, 2011 - 1:22 am 6 Comments


I get that "compliment" a lot and I just laugh. Better than making a ton of money to flirt and have fun? I enjoy the job and don’t ascribe to outdated, misogynist (yes, misogynist, you’re all indoctrinated by ancient man-made religions that tell you sex is bad in order to keep women from using their sexual power over men) social mores. I’m not at all worried about "just being valued for my body" (a common "feminist" argument against the sex industry) as I do other things besides strip. I just don’t deny the sexual side of myself!

Atheists: What part of this statement from Jesus do you find fault with: “If you ask Me anything in My name?

July 17, 2011 - 9:13 am 14 Comments

I will do it. If you love Me, you will keep My commandments."

Some of them likely put that statement to the test, thus evolving to atheism.

Can you still be convicted of a crime if the victims have withdrawn their statements?

July 10, 2011 - 9:34 am 13 Comments

If you have been arrested for something and you have admitted to it, the victims have withdrawn their statements but you still have to go to court, can you still be found guilty if the victims have dropped the charges?

Sure.

If the Crown Prosecution Service decides to prosecute, and have sufficient evidence without those witness statements to convince a jury of your guilt, then absolutely you can be convicted.

In the UK, prosecution of criminal offences is viewed as a matter of public interest rather than up to the victim. It is ultimately in everybody’s best interests to punish crime and, where necessary, take dangerous people off the streets.

MS Excel - IF Statement limit?

July 7, 2011 - 1:02 pm 2 Comments

I’m trying to write a ‘code’ in Microsoft excel that will enable it to count in binary for me. I’ve got as far as 3bits of numbers on the first byte and now it’s appearing with an error. I need help to find out why it’s stopped and how to surpass this issue.
I’ve got 1-100 in column A4-A104. B3-L3 have 1024-1, and in the lines B4-E4 the codes thus far are as follows:
B4: =IF(A4>B3,1,0)
C4: =IF((A4-B4*B3)>C3,1,0)
D4: =IF((A4-B3*B4+C3*C4)>D3,1,0)
E4: =IF((A4-B3*B4+C3*C4+D3*D4)>E3,1,0)

F4 says: =IF(A4-B3*B4+C3*C4+D3*D4+E3*E4)>F3,1,0)
Which I know is correct, however it’s saying it’s got an error. So I assume either it’s got a length limit or a frequency limit. So I need someone to tell me what’s wrong and how to go about fixing it. I’d appreciate any help offered! Thanks!

Andre.

=IF(A4-B3*B4+C3*C4+D3*D4+E3*E4)>F3,1,0)

That is NOT correct, you’re missing a parentheses

=IF( (A4-B3*B4+C3*C4+D3*D4+E3*E4) > F3, 1, 0 )

Also, have you tried this?

=DEC2BIN(A1,8)

A1 is the cell with the number you want to convert, 8 is the number of digits to display