Nesting IF statements in Excel 2010 - excel

How do I nest IF statements in Excel 2010? I found my inspiration trying to organize data from Evolus Pencil Support Tickets.
Here is my desired result: I want to nest IF statments to choose between different status levels, such as Fixed, New, Invalid, Done, Duplicate, etc. However, I had to make several tables to achieve this and when I tried to test it, the IF statement only gives me the first choice (Fixed).
Here is the formula to test whether the number is 1-6 and add on the number, and the status level:
=IF(U2="1",
CONCATENATE(VALUE(U2),$V$2,IF(U2="2",
CONCATENATE(VALUE(U2),$W$2,IF(U2="3",
CONCATENATE(VALUE(U2),$X$2,IF(U2="4",
CONCATENATE(VALUE(U2),$Y$2,IF(U2="5",
CONCATENATE(VALUE(U2),$Z$2,IF(U2="6",
CONCATENATE(VALUE(U2),$AA$2,"NO")
The result, however, in the corresponding cells is: Cell is U2 1FixedFALSE Cell is U3 false
Please check out the spreadsheet here
http://win7guruquestions.posterous.com/my-spreadsheet-illustrating-selection-and-if
I hope that you can help me with this. Thanks in advance

the formula posted is missing closing brackets. On the assumption it should be
=IF(U2="1",CONCATENATE(VALUE(U2),$V$2),
IF(U2="2",CONCATENATE(VALUE(U2),$W$2),
IF(U2="3",CONCATENATE(VALUE(U2),$X$2),
IF(U2="4",CONCATENATE(VALUE(U2),$Y$2),
IF(U2="5",CONCATENATE(VALUE(U2),$Z$2),
IF(U2="6",CONCATENATE(VALUE(U2),$AA$2),"NO"))))))
it works, provided values in U2 are entered as strings.
An alternative formula:
=IF(AND(VALUE(U2)>=1,VALUE(U2)<=6),U2&INDEX($V$2:$Z$2,1,VALUE(U2)),"NO")

Related

Excel: Using an IF() Function with Conditions Depending on Other Cells

I am writing an excel script for my company, and I am getting hung up on something. I have written a formula that calculates pay for a certain benefits we have.
This paragraph explains parts of the spreadsheet that work. If the employee was here for at least a year, they receive their benefit. If not, they are not eligible. I have a column that has a condition for their eligibility using the IF() function and determines whether or not they are eligible by their hire date. I also have a column that says the total pay from their benefit (6 percent of their normal hourly rate multiplied by their hours worked).
The issue I need help with is the last separate column that determines their pay if they are in fact eligible. What I want to do, is if the eligibility is true, have the cell display their benefit pay. If they are not eligible, I want the cell to display 0 (I already have a column saying if they are eligible or not to prevent confusion).
The formula I currently have looks like this:
=IF(V2="Eligible for SWW Pay",=T2,=0)
where V is the eligibility column and T is the pay given from their benefits. The formulas in both T and V give the correct output. However, this formula for the last column gives me an error. I don't know if it is a syntax error or if my logic is totally wrong for doing this.
Does anyone have any idea what I am doing wrong? Any feedback is greatly appreciated!
Thanks,
Nick
I would propose you the following formula:
=IF(V2="Eligible for SWW Pay",T2,0)
The equal-signs in front of T2 and 0 are not needed.

Ranking formula in excel based on two columns

I'm trying to rank the following items based on price using the following formula =SUMPRODUCT(([Item]=[#Item])*([#Price]<[Price]))+1, but it isn't returning any results:
When I use the same formula in the following test table it works, =SUMPRODUCT(($A$2:$A$7=A2)*(B2<$B$2:$B$7))+1:
Can someone please let me know what I am doing wrong? Thanks
EDIT 2 : Evaluation https://imgur.com/a/eXIYPAP
Your formula works fine for me.
Are you sure that A2 and A3 are the same value? There may be some hidden white space causing problems. Just try
=A2=A3
in another cell to make sure they are the same.
USE COUNTIFS INSTEAD
I don't know why your formula isn't working, however, I would suggest avoiding SUMPRODUCT where you can.
=COUNTIFS([Item],[#Item],[Price],">"&[#Price])+1
This will count the number of prices higher than the current one for each item (+1, if you want the rank to start at 1 instead of 0)
If your goal is to get the ranking for each unique item, =SUMPRODUCT(([Item]=[#Item])*([Price]>[#Price]))+1 should do the trick. If the goal is to get the ranking based only on price, don't have it figured out yet.

COUNTIF formula counts values that don't match

I'm using counting invoice numbers (text) in a table's column, but the Excel formula seems to be confusing some values.
I copied small sample of these - please refer to below:
The formulas are as follow:
=COUNTIFS(A1:A19,A1)
=COUNTIF(A1:A19,A1)
As you can see these invoice numbers differ and the results of these functions suggest as if all were the same.
I googled it for 1 hour but I didn't find such as issue as mine.
If anybody had any clue why could this behave in such way I'll be super grateful!
Rob
Each time you copy down this formula it will add 1 row to each. For example the second row of datas formula will be =COUNTIFS(A2:A20,A2). To lock these cells in the formula use $
Your formula should be =COUNTIFS(A$1:A$19,A1)
I've solved this myself:
ROOTCAUSE
Excel tried to be helpful and read these invoice numbers as actual numbers (despite these being defined already in Power Query as text)
Then, Excel fooled me and despite showing that it works on it as a string (I was evaluating the formula) it worked on it as number
Above means that it transformed exemplary "00100001010000018525" to 1.00001E+17, which cut down this to "100001010000018000" - that's the moment Excel stopped fooling around and showed that value in the formula bar.
I think I don't need to tell why countif perceived all these values as equal.
SOLUTION
I simply appended one letter after each invoice number to get e.g. "00100001010000018525a" what forces Excel to quit its gimmicks and games.
Case closed.
I suspect this is a bug in COUNTIF, or maybe by design.
However, to workaround this in the formula, without having to change your data, try adding a wild-card character:
=COUNTIF(A1:A19,"*"&A1)

How to identify the cells from the sumproduct formula result

I would first like to apologize if this question has already been posted and answered numerous times but I was unable to find the right wording for my question to find a thread that matched.
I have a Sumproduct formula with multiple criteria that helps identify the number of issues I have on the main spread sheet. I got the number of issues, however now I would like to identify the cells meeting this criteria. Is there any way to do this?
To further explain my intention, the main tab on my spread sheet is a report with many different columns that would need to be filtered several different ways each time in order to catch the exceptions we are looking for. I am trying to avoid this manual process by creating a new tab to show these exceptions without having to look for them and leave cause for any user/human error where something could potentially be missed. In a new tab, I used several formulas (like the one below) to determine the number of different exceptions we need to catch, however I am wondering if there is a way to also identify these specific cells that the exceptions fall in so that the user can immediately locate and correct it.
For example: 2 issues identified; B10 and B26. (Or more specifically, if possible, the contents of that given cell?)
Sumproduct:
=SUMPRODUCT(--(May!C2:C452="FHA"),--(May!Z2:Z452<>""),--(May!AB2:AB452<>""),--(May!AC2:AC452=""))
Note: I have also tried to achieve this by using conditional formatting using the formula above, however the issue that I run into with that approach is that the entire row gets highlighted instead of the specific cells matching the criteria from the formula. I am open to a solution with this as well if it is an easier approach.
I hope I am getting across what I am trying to do! Thank you in advance to whomever can help!
Consider adding an additional column to the May worksheet. The new column would contain formulas like:
=(C2="FHA")*(Z2<>"")*(AB2<>"")*(AC2="")
If you AutoFilter on this new column, you will see all the contributors to the SUMPRODUCT() formula.
Your 2 issues identified; B10 and B26 appears to refer to cells that have no bearing on what you seek to achieve so I may have misunderstood but suggest selecting A:AC and applying a CF formula rule of:
=AND($C1="FHA",$Z1<>"",$AB1<>"",$AC1="",OR(COLUMN()=3,COLUMN()=26,COLUMN()=28,COLUMN()=29))

How do I create an =IF(OR()) statement which will count the number of true/false conditional values?

My Uncle is asking me to help his police department fix their excel sheet. They track call codes in an excel sheet which looks like this:
.
Rows in the top image are individual calls which are categorized by the numbers in A-B-C 40+ (Radio Signals, bottom image) based on the subject of the call. In my example I've placed 3 call signals from row 46 in Radio Signals as well as row 49. Now what I'd like to see happen is a count of 3 in both E46 and E49.
The issue I'm having is a limited knowledge of programming Excel statements. I know there are IF statements I can use in conjunction with AND and OR statements but this seems very long and tedious. Based on the current setup of this document, could I use a more efficient method to gain a count of signals belonging to this cell?
Any help is greatly appreciated.
Assuming your list of calls is in Sheet1 column A and the comma separated list is in Sheet2, place the following formula in Sheet2:
=SUM(--ISNUMBER(SEARCH(" "&Sheet1!$A$:$A$&","," "&Sheet2!A46&",")))
Make sure to press Ctrl-Shift-Enter when entering the formula!
Using the COUNTIFS statement works well. The following formula worked like a charm for counting occurrences of multiple conditions over a range of cells.
For Cell 46-E
=COUNTIFS(A7:A39,"=37")+COUNTIFS(A7:A39,"=56")+COUNTIFS(A7:A39,"=64")+COUNTIFS(A7:A39,"=65")+COUNTIFS(A7:A39,"=70")+COUNTIFS(A7:A39,"=81")+COUNTIFS(A7:A39,"=91")

Resources