Whats wrong with this formula - excel

Excel and coding newbie. Getting very frustrated with a very specifc formula which should be simple.Can anybody tell me what wrong with this formula
=IF(W12<50,"U",IF(W12<65, "P",IF(W12<80,"M",IF(W12<101,"D"))))
Its picking up a specific value at cellW12 and supposed to generate a grade in a spreadsheet based on that formula
Should be easy but can't get it to work.

You need to use ";" instead of "," (At least in my version; German version of EXCEL 2006 and 2016).

Related

Excel Vlookup Date - Create List with multiple values

Good Morning,
I'm trying to make a list of all items done on a certain date Using Vlookup. Date would be on R8.
The first two highlight were place as an example of what I'm wanting it to look like.
Can someone help me figure out this formula please!
I tried this formula from a website I found but I cant seem to make it work.
=(INDEX($B$9:$B$150,SMALL(IF(R$8=$A$9:$A$150,ROW($B$9:$B$150)-2,""),ROW()-2)))
If you're using office 365:
In cell Q10 type:
=FILTER(B:C,A:A=R$8)

Error in formula on Excel 2010

Well, I tried to make a formula on Excel 2010 in order to get flexible results.
The idea is to count cell written less cells empty, so the formula should be: =CONTAR(C10:C69) - CONTAR.BLANCO(C10:C[VALUE])Where the Value is 8 + the result of CONTAR(C10:C69).
The real formula actually extends more than this, but I got stuck at this step.
That being said, how can I produce the same result using Visual Basic to actualize the list every time excel is modified?
Thanks in advance!
EDIT: thank you for the correction
The best way is to use Index to return a reference to the range from C10 to C[Value]
=COUNT(C10:C69)-COUNTBLANK(C10:INDEX(C:C,8+COUNT(C10:C69)))
(I hope I have got the correct equivalent functions for Contar etc.)

Concat/Concatenate Error

All, I come before you with a puzzle that I cannot figure out.
I recently transitioned to Office 365 from 2010 and am having a world of difficulty adapting my formulas and scripts to work in the new platform.
Particularly, I am running into an issue where one of my SUM(IF(CONCATENATE formulas can no longer find data.
Previously, in 2010, I had a formula as follows:
{=SUM(IF(CONCATENATE(B8,C8,D8)=CONCATENATE(ProjectData!A2:A20000,ProjectData!C2:C20000,ProjectData!W2:W20000),ProjectData!T2:T20000))}
This formula would sum a range of numbers if 3 cells matched 3 cells in a range of data.
This no longer works in Office 2016.
Has any syntax changed that might be causing this error? Thanks in advance.
Use SUMIFS()
=SUMIFS(ProjectData!T:T,ProjectData!A:A,B8,ProjectData!C:C,C8,ProjectData!W:W,D8)

Excel TEXT formula doesn't convert 'yyyy' to a year

I want to combine some text with a date in Excel 2013.
Let's say I have a cell A2 with a date like 30-10-2014. I tried to append the date after the text with this formula:
="Some text and a date: "&A2
But the output shows the date as a number: Some text and a date: 41942
So I tried it with the TEXT formula:
="Some text and a date: "&TEXT(A2;"dd-mm-yyyy")
But this shows Some text and a date: 30-10-yyyy and not Some text and a date: 30-10-2014
So or I do not understand how the TEXT formula works or is there some bug / issue here?
UPDATE: It looks like it's important that I have a Dutch version of Windows (7) but an English version of Excel (2013) which causes this issue!
All kudos go to #AxelRichter, thanks Axel!
It looks like that if you have a Dutch Windows but an English version of Excel (2013) the formulas get mixed up. For example, I still have the English formula names like TEXT (which would be TEKST in Dutch) but still have to use a colon instead of a comma in the formula. The format_text value of TEXT still expects the Dutch format which is different for the year (jjjj instead of yyyy).
So if you have a Dutch Windows and an English Excel version the correct formula for some text followed by a formatted date would be:
="Some text and a date: "&TEXT(A2;"dd-mm-jjjj")
I hope Microsoft will fix this, this is very annoying!
You can now use 'e' instead of 'yyyy'. The e is the universal version of yyyy a
we have the same issue at our work and I found that if I cannot influence the localization of the windows then I use a formula which in your case looks like:
="Some text and a date: "&TEXT(A2;"dd-mm-")&YEAR(A2)
It is funny that "dd" and "mm" is the same.
Excel here obviously fails. TEXT should be language agnostic.
The workaround I found, especially if you have multiple cells to format:
Calculate the desired date format in a hidden cell or white colored:
=IF(TYPE(VALUE(TEXT(DATE_CELL;"YY")))=1;"DD.MM.YYYY";"ДД.ММ.ГГГГ")
If you need, it can be extended to support multiple regions like:
=IF(TYPE(VALUE(TEXT(DATE_CELL;"YY")))=1;"DD.MM.YYYY";IF(TYPE(VALUE(TEXT(DATE_CELL;"ГГ")))=1;"ДД.ММ.ГГГГ";"DD.MM.JJJJ"))
On cells where you need dates, use previous cell as second parameter:
="Date: " & TEXT(DATE_CELL; FORMAT_CELL)
For same problem when your system or keyboard is Danish then use åååå in place of jjjj. I also struggled a lot to find this key.
However if anyone facing same problem apart from Dutch or Danish then you can check which key is correct. To find it right click on any cell and goto 'Format Cell' then select 'Custom' and find date related formats in your local language. There you can find which is the right key to be used for DATE format in your local language.
This issue is still there on Excel 2016 (or Office 365, if you may). It is caused by different language settings in Windows. This happens for languages that have different year symbols (dutch is 'jjjj', portuguese is 'aaaa'). If you're experiencing this problem, try using your local Windows language's year format.
This should work regardless of your system language or regional settings:
="Some text and a date: "&TEXT(DAY(A2);"00")&"-"&TEXT(MONTH(A2);"00")&"-"&TEXT(YEAR(A2);"0000")
Click here to see it working
[Edit] I just tested the solution with German (TT.MM.JJJJ) and English settings (DD.MM.YYYY) and it works fine!
You may need to use , instead of ; in the MS EXCEL formula (depending on your actual list separator symbol --> check your OS settings!).
Solution: To check if "jjjj" format is working:
The date you want to display in a certain format is in A1
In cell A2 link a cel to the cel with the date you want displayed in a certain format with the following formula:
=TEXT(A1;"dd/mm/jjjj")
In a 3rd cel you then place the following formula:
=IF(RIGHT(A2;4)="jjjj";TEXT(A1;"yyyy");TEXT(A1;"jjjj"))
If the 4 digits from the right are "jjjj" this formula will display the date formatted as "yyyy" else the formatting "jjjj" will be used.
The easy fix, whether directly custom formatting a cell or using TEXT(), is to use a country code for a language you know the proper formatting codes for.
For instance, I am in the US, have a US version of Excel, and am familiar with its date code formats. So I'd want to use them and to ensure they "come out" regardless of anyone's Windows or Excel version, or the country they are in, I'd do it like the following (for TEXT(), let's say, but it'd be the same idea in custom formatting):
=TEXT(A1,[$-en-US]"dd-mm-yyyy")
The function would collect the value in A1, ask Excel to treat it as a date, Excel would and would say fine, it's cool (i.e.: the value is, say, 43857 and not "horse") because it is a positive number which is a requirement for anything to be treated as a date, and let the function move on to rendering it as a date in the manner prescribed. Rather than giving an #ERROR! as it would for "horse" or -6.
The function would then read the formatting string and see the language code. It would then drop the usual set of formatting codes it loaded upon starting up and load in the formatting codes for English ("en") and in particular, US English ("US"). The rest of the string uses codes from that set so it would interpret them properly and send an appropriate string back to TEXT() for it to display in the cell (and pass on to other formulas if such exist).
I have no way to test the following, but I assume that if one were to use a format that displayed day of the week names or month names, they would be from the same language set. In other words, Excel would not think that even though you specified a country and language that you still wanted, say, Dutch or Congolese month names. So that kind of thing would still need addressed, but would be an easy fix too just involving, say, a simple lookup one could add though it'd be "fun" setting up the lookup table for each language one wanted to accomodate...
However, the basic issue that arises here, and with this problem in general, is very, very easily solved with the country codes. They aren't even hard or arcane anymore now that the [$-409] syntax has been replaced with things like [$-en-us] and [$-he-IL] and so on.
If VBA is an option... works for any locale/language
Public Function dateYYYYMMDD(dt As Date) As String
dateYYYYMMDD = Format(dt, "yyyyMMDD")
End Function

Showing New and Old by Date using 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",""))

Resources