Showing New and Old by Date using Excel - excel

long time no chat, I am running into a situation in where a formula I wrote up seems not to be working correctly. I know it's probably me, but logic based programming seems to be the bane of my existence.
=IF(D1>2010,"New",IF(D1<2010,"Old",""))
Is the formula in question, now if I got this down correctly, which I thought I did, is that if D1 is greater than the year 2010 the cell would say New, and if it's less than 2010, it would say Old.
It's not working, for some reason I can't figure out why.
I have a similar formula that works:
=IF($B155<>"","Full",IF($J155<>"","Full","Empty"))
I figured the logic would be similar, it seems I'm wrong. Can someone help me solve this simple quandary, logic based math has never been my strong suit. Thanks.

If D1=2010, there's no true condition in IF clauses, and the result will be a blank cell ("").
=IF(D1>=2010,"New",IF(D1<2010,"Old","")) should do the trick.
If D1 is formatted as a Date, the following formula will give the desired result:
=IF(YEAR(D1)>=2010,"New",IF(YEAR(D1)<2010,"Old",""))

Related

Nested if/ and/ or statement excel

Could somebody help with a question I have. I'm stuck with an excel formula. I need an indicator to tell me when something is on target or out of target.
I've attached a screen shot of an example where I have a deadline, the date it was completed and what it should read along with how far I got writing a formula. If somebody could help me I would be grateful.
It should flow like this; if deadline(A2) is before today and date completed (B2) is blank OR/AND if date completed (B2) is more than the deadline (A2) then it is out of target, if not it is in target. Can't get it right so help would be appreciated.
=IF(AND(ISBLANK(B2),A2>TODAY(),OR(B2>A2)),"On Target","Out of Target")
Excel pic
So perhaps your logic should be:
OR(B2>A2,AND(ISBLANK(B2),A2>TODAY())
Based on what you wrote.
So, based on the comment you STILL need the if() statement:
=IF(OR(B2>A2,AND(ISBLANK(B2),A2>TODAY()),"On Target","Out of Target")
To get it to work. I did assume that suggesting you correct the logic was enough.
This should work for you, try, so you may use either of the ways using IF() or using CHOOSE()
• Formula used in cell C2
=CHOOSE((((A2>TODAY())+(B2=""))+(B2>A2))+1,"On Target","Out Of Target")
Or,
• Formula used in cell D2
=IF(OR(OR(A2>TODAY(),B2=""),B2>A2),"Out Of Target","On Target")

Formula using sumifs and indirect function for worksheets. Getting Reference error although Had it working with different columns

Using excel 365. I have used this same formula for "asset allocations" and it worked perfectly.
I decided to do the same for sector allocation and I can not figure out what is wrong. This has beat me down. I have tried for 2 days. I thought that I could just exchange the category for sector. Didn't work. Thank you for any help.
Here is the image which shows the sheet that I am using.
The formula in G6 is:
=SUMPRODUCT(SUMIFS(INDIRECT(K$6:K$11&"[Value]"),INDIRECT(K$6:K$11&"[Sectors]"),[#Sector]))
You can see a REF Error on the column "Value".
This image is to show where the "Sectors" are listed on the individual sheets that I wish to sum.
Unusual, but this is working fine in my test scenario.
Use the Evaluate Formula tool to see where the error creeps in. You may have a typo in the list of tables.
I should have found the answer earlier but I didn't question my table columns.
In my last table the Column was accidentally called "Sector" and it should have been called "Sectors". I needed to pinpoint the point of problem by debugging better.
This code does indeed work fine for anyone wishing to sum by a category from more than one sheet. Not saying it is elegant code but it is easy to understand.

Problems with SUMIFS in Excel when using external reference

After doing a lot of research and trying various potential solutions, I am still stuck and hoping someone may be able to point me on the right track.
I am using a SUMIFS function in an Excel 2010 spreadsheet, but whilst it works when the reference spreadsheet is open, it gives a #VALUE error when the reference spreadsheet is closed.
My searching so far has identified that this is a known issue with Excel, but though I have tried various workarounds that are posted on forums, I haven't been able to make any work. I don't get a #VALUE error, but instead I get a zero.
The original formula is as follows:
=SUMIFS('P:\Performance\[All calls.xlsm]Jan 2016'!$N:$N,'P:\Performance\[All calls.xlsm]Jan 2016'!$R:$R,$B2,'P:\Performance\[All calls.xlsm]Jan 2016'!$G:$G,$C2,'P:\Performance\[All calls.xlsm]Jan 2016'!$J:$J,"pri")
As I say, this works fine when the other workbook is open (it obviously drops the "P:\Performance\" pre-fix), but not when it is closed (though it does change the reference to the full path).
So as per other suggestions, I have tried using SUMPRODUCT...
=SUMPRODUCT(--('P:\Performance\[All calls.xlsm]Jan 2016'!$R:$R=$B2),--('P:\Performance\[All calls.xlsm]Jan 2016'!$G:$G=$C2),--('P:\Performance\[All calls.xlsm]Jan 2016'!$J:$J="pri"),('P:\Performance\[All calls.xlsm]Jan 2016'!$N:$N)
However, this results in zero, which is clearly incorrect as the SUMIFS version and open workbook gives me a non-zero value.
Working through the calculation steps, I suspect it may have something to do with the reference cells themselves being based on formulae, but I'm not certain. Incidentally, I get the same result whether the reference workbook is open or closed.
Any ideas?
Thanks very much.
PS: I also looked at the Microsoft support site, but although it gives the impression that there is a workaround on the site, the hyperlink leads you back to the same place...
How to correct a #VALUE! error
OK, so first of all thanks to the two people who commented. I didn't need to take a look at the suggested "similar question", because I managed to resolve it myself.
The SUMPRODUCT solution posted elsewhere did in fact work. The issue turned out to be a strange situation with one of the columns I was referencing. On closer examination, I discovered that although the column was formatted as "short date", for some reason, some of the entries were not being recognised as such. I have no idea why this was, but when I converted the column to "number", it was obvious, as some of the dates failed to turn into date numbers. Strange, as all the entries were being created by a formula. So this was why the SUMPRODUCT formula was returning a zero very time.
Anyway, I found the solution here...
Some dates recognized as dates, some dates not recognized. Why?
I have no idea why this worked, but it did. And now the SUMPRODUCT workaround works, with the target spreadsheet closed. Maybe this will help someone else, or maybe it won't, but it does pay to check and double check the format of any cells you are referencing.

Excel - CountIfs (column A has target value, column B is blank)

First post, sorry if it's not according to site preferences. I searched around and couldn't find a post that was exactly like this, but sorry if this is a repeat as well.
I have the following code:
=COUNTIFS(A:A,"="&C3, B:B,"<>""")
For clarity, the code is supposed to identify instances where column A has a specific value (C3), and where column B is empty.
I'm familiar with Countifs, but it was the "if blank" portion that I've been really struggling with. On top of that, column B is populated with formulas, making this seemingly more challenging from my perspective as a couple methods I've tried only work if the cells are truly unpopulated. What I can say is that this formula is working with almost all of my examples, except 1, and I have no idea why this would be. For that matter I'm not entirely sure why this code works at all.
Any insight would be greatly appreciated.
Thank you very much.
To count if blank: "="
=COUNTIFS(A:A,"="&C3, B:B,"=")
Or if this is easier to understand:
=COUNTIFS(A:A,"="&C3, B:B,"=" & "")
Which is the same.
"=" in COUNTIFS does not match blanks that result from formulas. Dont ask me why!
As workaround, you can use the flexible and never vexing SUMPRODUCT:
=SUMPRODUCT((A:A=C3)*(LEN(B:B)=0))

Excel: Formula error when value is zero

I have used a formula to create a point system for my class. My formula is below, and it works great except that when C2 is zero, the score still shows "10" when I'd like it to be zero as well. I realize that this is an error in my formula but I can't seem to fix it without excel giving me an error message. Could anyone help me edit this formula to fix it?
(I'm a teacher and I'm just trying to make my life a little easier with excel.)
IF(TRIM(C2)="","",IF(C2<6.99,10,IF(AND(C2<=7.99,C2>=7),9,IF(AND(C2<=8.99,C2>=8),8,IF(AND(C2<=9.99,C2>=9),7,IF(AND(C2<=10.99,C2>=10),6,IF(AND(C2<=11.99,C2>=11),5,IF(AND(C2<=12.99,C2>=12),4,IF(AND(C2<=13.99,C2>=13),3,IF(AND(C2<=14.99,C2>=14),2,IF(AND(C2<=15.99,C2>=15),1,IF(AND(C2>=16,C2<=100),0))))))))))))
your first if statement says if c2 is nothing then its blank. why not make another one that check if its 0
This is untested but try
IF(TRIM(C2)="","",IF(TRIM(C2)=0,0,IF(AND(C2<6.99,10,IF(AND(C2<=7.99,C2>=7),9,IF(AND(C2<=8.99,C2>=8),8,IF(AND(C2<=9.99,C2>=9),7,IF(AND(C2<=10.99,C2>=10),6,IF(AND(C2<=11.99,C2>=11),5,IF(AND(C2<=12.99,C2>=12),4,IF(AND(C2<=13.99,C2>=13),3,IF(AND(C2<=14.99,C2>=14),2,IF(AND(C2<=15.99,C2>=15),1,IF(AND(C2>=16,C2<=100),0))))))))))))))
Again this is untested but hopefully you see what I am trying to do.
Perhaps:
=IF(C2="","",IF(C2=0,0,MAX(ROUNDUP(MIN(16-C2,10),0),0)))

Resources