Forgive me as I'm a bit of a novice with Excel and have no idea if this is possible or not. Looking for a formula to return one of four values, based on two criteria. One is a Drop-down list with either "Sun-Sat" or "Thur-Wed" options, and the other is a date value. If the date entered falls on a Monday or Tuesday it should return one value, and if the date entered falls on a Wednesday/Thursday/Friday it should return another.
A B
Sun-Sat Thurs-Wed
1 Monday/Tuesday 28/06/2015 25/06/2015
2 Wednesday/Thursday/Friday 5/07/2015 2/07/2015
Drop down box is cell B6 and Date is cell A6
I hope that is enough detail, any help is greatly appreciated!
Say you have these on the "Match" sheet:
A B C
1 Sun-Sat Thurs-Wed
2 Monday/Tuesday 28/06/2015 25/06/2015
3 Wednesday/Thursday/Friday 5/07/2015 2/07/2015
And say you keep the first criterion(Match!$A) in A2 and the second (Match!$1) in B2.
The formula you'll need is:
=INDEX(Match!$1:$1048576;MATCH($A2;Match!$A:$A;0);MATCH($B2;Match!$1:$1;0))
The MATCH() formulae provides the indices that the INDEX() formula uses to identify the output cell.
As pnuts have highlighted I missed that it was one date and one validation.
=INDEX(Match!$1:$1048576;MATCH(IF(OR(WEEKDAY($A6)=2;WEEKDAY($A6)=3);"Monday/Tuesday";"Wednesday/Thursday/Friday");Match!$A:$A;0);MATCH($B6;Match!$1:$1;0))
is an augmented version for when the A column contains dates. Note: I treated the two sets as alternatives, the weekends will be wrongly classified if existent.
Edit not from answerer - layout might be closer to OP's, with formula adjusted to suit (also shows results from various inputs):
I'm trying to create an spreadsheet where INDEX/MATCH automatically populates monthly sales goals. However, it is returning the wrong number.
In cell B6 I want the value to be 10000. In columns G and H, I've set the goals and the corresponding date in the hopes of matching the goal to the date in row 2.
B6 is returning "6000" AND "7/19/2015" in an adjacent cell when it should just be returning "10000" ... and I don't know why.
In H6 the goal for the 7/12/2015 is set at 10,000 from cell G6, which corresponds to the date in B2, so I don't know why it is returning the date AFTER the one I'm matching.
Thanks
The second part of the formula, the match part, needs to have "H3:H9", not G. The match is looking for your B2 (a date) in the range $G$3:$G$9, which is numbers so there won't be a return of the date.
Edit: And #Jeeped makes a good point, since the dates are going to be found in your table, you would probably be better using "0" instead of "1" at the end - "0" will look for an exact match. If you keep 1, it might return a false positive (return a date that is NEAR your lookup date, not the exact one).
Place in B6 and copy across:
=INDEX($G3:$G9,MATCH(B2,$H3:$H9,1))
Basicly i have a list of information and i need to be able to enter a start data in one cell and a end date in a different cell and then return all the dates between them.
eg.
input input
1/1/14 2/2/14
Return
Date Name
14/1/14 bob
17/1/14 bob2
20/1/14 bob3
Dont no if you can do this with vlookup or index and match but any help would be good
thanks all
Probably your best bet is an IF(AND) statement.
=IF(AND(G6>E6,G6<F6),TRUE)
Where G6 is the date you are checking, and E6 and F6 hold the date range. TRUE can be replaced with any value, including a reference to a different cell.
I use excel for my budget. The top row has the dates when I am paid. I wrote a function called Between which determines if the date I am suppose to pay a particular bill will occur within the timeframe specified in Between. If it does, it will fill the cell with the correct value, otherwise blank. The arguments for Between are Between([cell with start date],[number of days in period], [date to test is in the period],[value to fill cell if date in period]). So, say A1 has 9/1/2014. Between(A1,14,7,500) would put 500 in the cell since the 7th is between 9/1 and 9/15. If A1 was 9/20/2014, the cell would be blank since the 7th is not between 9/20 and 10/4.
I would like to check if Between returns a value vs a blank so I could fill empty cells with a 0 so I can sum up numbers in a row. Suppose I had this expression in a cell say B12:
=IF(ISBLANK(Between(A1,14,7,500),0,?) I want the ? to be the value of Between in the IF statement. How can I get the value of Between into the cell if Between does not return blank?
Just repeat it:
=IF(ISBLANK(Between(A1,14,7,500)),0,Between(A1,14,7,500))
The N function converts non-numbers to 0, so you could try:
=N(Between(A1,14,7,500))
I have an Excel formula reading data from a column. The data in that column is sometimes a date-like format, such as "10-11". Despite the fact that I've ensured that column is text formatted -- and all values display correctly as plain text, not reinterpreted as dates -- the formula is basically reinterpreting them as dates in the reference.
I need a way to force the formula's cell reference to interpret the cell as text. I tried TEXT(A1, "#") but it doesn't work -- it gives the numeric value of the date.
Brian Camire's answer explains why, but here's a worksheet function that will work for you. Note that you have to create that numeric array in it based on how long the longest string will be. It's an array formula, so when you first enter it you have to hit CTRL-SHIFT-ENTER, then you can click and drag it down the column.
=LEFT(A1, MATCH(FALSE, ISNUMBER(VALUE(MID(A1, {1,2,3,4,5}, 1))),0) - 1)
Short answer: When referring to number-like (or date-like) text values in a formula, don't use them in a place in the formula where Excel is expecting a number.
Long answer: Even if the source column is formatted as text and the values in the source column are truly entered as text (and not numbers, including dates), Excel may automatically convert text values to numbers (including dates) when you reference them in a formula if you use them in a place where Excel is expecting a number (or date).
For example (assuming US date formats), in a blank worksheet:
Set the format for column A to Text.
In cell A1, enter the value 10-11.
In cell B1, enter the formula =T(A1). The T() worksheet function returns the supplied value if it is text. Otherwise, it returns an empty string. The result of the formula in cell B1 should be 10-11, indicating that the value of A1 is text, not a number or date (in which case the result would be an empty string).
In cell C1, enter the formula =A1.
In cell D1, enter the formula =T(C1). The result should also be 10-11, indicating that the value of the formula in C1 is text, not a number or date. This shows that you can (sometimes) use a text value that looks like a number (or date) in a formula and have Excel treat it as text (which is what you want).
In cell E1, enter the formula =A1+0. The result will be 40827. This is the numeric value of the date October 11, 2011. This shows that you can (sometimes) use a text value that looks like a number (or date) in a formula and Excel will automatically convert it to a number (which is what you observed) if you use it in a place (like on either side of the + operator) where Excel is expecting a number.
To insert a value into a cell and have it not be auto-formatted, and just treated as text, you can enter it like this:
=("cell data")
eg:
=("+1 3456789")
When you use &"", Excel converts the results of a formula to text (like *1 would convert to numbers).
Thus, you can use this formula:
=TEXT(A1;"jj-mm")&""
If you put a single quote in front of the text in the cell, it should be represented as text on all references:
'10-11
Just add zero to the input!
I was having a similar problem where I had a list of numbers with a text prefix (like FOO-1, FOO-25, FOO-979) but I just wanted the number part (1, 25, 979) so I could run another formula off of that. I was using SUBSTITUTE to replace the text portion with blank, but my other formula using these numbers was coming up with bogus results. I ended up making my formula like this:
=SUBSTITUTE(B1:B10,"FOO-","")+0, and now the ISNUMBER is saying TRUE where before it was saying FALSE.
In my case, I have a form worksheet that is used by dealers to ad parts and have it calculate the final cost; it references a locked "products" sheet. The problem is that I had no way of controlling what they entered.
Products can be like:
101 = A true number
7-2009 = Reads as date
7-5601-RT = TEXT/NUMBER reads as both number or text (NOT SOLVED YET)
CP6072CD = reads as plain text
I have most of this figured out; the only one that isn't is the one that reads as both text/Number.
In case anyone is looking for a similar solution, i did the following:
I created three additional columns to test and display the three different cases: "NUMBER", "DATE" , "TEXT".
DATE: =NOT(ISERROR(DATEVALUE(B42)))
ISOTHER: =(ISNUMBER(--(MID(B42,ROW(INDIRECT("1:"&LEN(B42))),1))))
NUMBER: =ISNUMBER(B42)
NUMBER/TEXT: =NOT SOLVED YET
I42 = DATE
J42 = NUMBER
K42 = OTHER
L42 = TEXT
M42 = THE RESULT OF THE QUERY BELOW
=IF(AND(I42 = FALSE, J42 = FALSE, K42 = TRUE), "NUMBER", IF(AND( I42 = TRUE, J42= FALSE, K42=TRUE), "DATE", "TEXT"))
This (ABOVE) tests all the true/false results and depending on what the value turns out to be, I format each of them using:
ISNUMBER = VALUE(B42)
DATE FORMATTED AS B42*1
ELSE TEXT - AS ORIGINAL
=IF(M42 = "NUMBER", VALUE(B42), IF(M42 = "DATE", B42*1, B42))
So now I just need to figure out how to test if something is both text and number because the 7-5601-RT tests out as the same as number: "FALSE, FALSE, TRUE, TRUE"