If Function To Return No. Based On 2 Cells?

Oct 14, 2008

I need help on using the If function. Basically I am trying to calculate the cost of shipments. For example, cost of sending 1 box is 150 (eg cell A3), 2 boxes is 280 (cell A4), 3 boxes is 400 (A5), 4 boxes is 500, etc upto to 10 boxes (cell A12).

What I am looking for is cell A1 to provide me the cost based on the manually entered value of cell A2, i.e. if I enter a number between 1 to 10 in cell A2, then A1 should return a number from A3 to A12, e.g. enter 3 in A2 then A1 should return 400.

Is there such a formula or do I have to enter manually the amounts into an If function?

View 11 Replies


ADVERTISEMENT

DATE Function & IF Function (return A TRUE Or FALSE Based On A Date In A Cell)

Dec 8, 2009

I am trying to return a TRUE or FALSE based on a date in a cell.

for example:

if cell A1 = 07/11/2009

I want A2 to show TRUE or FALSE if A1 is 14 days or more behind todays date.

I have tried stuff like:

=IF(A1=TODAY()-14,"True","False")

but it just always says false. EDIT: I have just noticed that if I change the date in A1 to exactly 14 days behind todays, it returns TRUE. So, it does work. Do I need to add a GREATER THAN in there?

View 6 Replies View Related

Function To Return Value Based On Two Criteria?

Aug 10, 2014

I'm working on a spreadsheet that I need to return a value to "Unit Price" field in worksheet "Master Inventory" based on matching the "Product" field and the "Construction" field from the "Unit Pricing" worksheet.

In essence, I would like the "Unit Price" field to match the "Product" field from the "Master Inventory" sheet to the "New Product Description" field on the "Unit Pricing" sheet, then match the "Construction" field on the "Master Inventory" sheet to the column headers on the "Unit Pricing" sheet and return the value that corresponds to both criteria.

Ex: On the "Master Inventory" sheet, I would like the "Unit Price" field to match the "Product" (Book Browser) to the "New Product Description" (Book Browser) on the "Unit Pricing" sheet and then return the value where the "Construction" (Laminate) matches the column header (Laminate) on the "Unit Pricing" sheet which would return the value of "$240.00".

I've tried using a vlookup function, vlookup/match function, index/match function and an index/match/match function. I've attached a sample workbook.

View 3 Replies View Related

Function To Return Value Based On OptionButton Choice

Feb 3, 2008

Ihave 2 functions which are called in my main program which should return a value due to what the user selects on a userform using option buttons and check boxes.

Function getnum() As Integer
If userform1.OptionButton1.Value = True Then
getnum = 1
End If
If userform1.OptionButton1.Value = True Then
getnum = 3
End If
If userform1.OptionButton1.Value = True Then
getnum = 5
End If
End Function

Function getlevel() As Double
If userform1.CheckBox1.Value = True Then
getlevel = 1.2
End If.......................................

View 3 Replies View Related

Getting Function That Will Return Numerical Value Based On Dropdown List

Aug 3, 2014

What I am trying to do is have a drop down list in one cell and have the next cell bring in the correct price for the item in the first cell. Sounds fairly easy? Well both lists are 200 items.

I have been trying to do this with just three items so far. On sheet two, I have created two lists. The first list in column A contains dogs, cats, mice. The second list in column B contains 1, 2, 3. On sheet one, I have created the drop down list for the animals in the A12 cell. I would like for B12 to auto populate the corresponding number to the animal without having to create an if formula for each animal and number.

View 4 Replies View Related

IF Function To Return Number Value Based On Various Text Options

Feb 27, 2014

I have two columns in a spreadsheet that I want to use an IF function with. In the first column, I want a pick list containing 5 text options. Depending on which option is chosen, I want a number to auto-populate in the second column.

The numbers are important, because I want to repeat this pair of cells with slightly different text values in the second pair, and then to have a column that multiplies the two resulting numbers and conditional formats the result.

View 14 Replies View Related

Formula/Function To Return Multiple Values Based On Criteria

Aug 25, 2006

I would like to be able to use the Vlookup function to return more then one value as a result of the criteria. I have a cloumn of dates that populates the X axis of a gantt chart with data whilst the Y axis will be populated by a site reference resulting in a program of work, the Y axis data is the result of a vlookup function. My difficulty arises however with multiple sites, for instance where two or three sites will be visited on the same day. The vlookup function will only return the first value it finds in a range to the formulated cell. The result being a missing site(s) from the gantt chart / work program. is it possible to return all values to a cell i.e. site1, site2, site3. using a vlookup or do i need to use another method of doing this?

View 2 Replies View Related

Function To Return Common Words To 2 Cells

Dec 29, 2008

I'm trying to write UDF which getting RegEx pattern and a certain cell as arguments and returns only matching string. For examples for string "The quick brown fox jumps over the lazy dog", and RegEx pattern "w{4}" the function will return two words "OVER" and "LAZY". What should I change in my code?

Function GetPattern(myPattern As String, myString As String)
Dim regEx As RegExp
Dim Matches As Object
Set regEx = CreateObject("VBScript.RegExp")

With regEx
.Pattern = myPattern
.IgnoreCase = True
End With
GetPattern = regEx.Replace(myString, "$1")
End Function

View 2 Replies View Related

Single Formula/Function Return Results To Multiple Cells

Aug 26, 2006

I've got an If statement in Excel which features several VLookups - I need the IF statement to return differing results to 2 different cells, is this possible?

In plain English, I'm looking for something like

If(Vlookup(A2, B2:D5, 4, False), C6="y" And D7="ok", "False")

Obviously this is a very crude example

View 3 Replies View Related

Macro To Return Data Of Cells Based On Other Cells

Apr 23, 2014

I have a worksheet that I want to populate with specific data from another worksheet.

If all of the following are met:

1) Column A equals "763" and

2) Column K is formatted Red (255, 0, 0) from conditional formatting

3) Column P is blank

Then in my blank worksheet I need to display the data from Columns A, B, D, K, O

View 4 Replies View Related

Excel Function To Return Nearest Non Blank Cell Value From Rectangular Array Of Cells

Jan 10, 2014

Assume you have a rectangular range. Say A1:M18. There are values in some random cells (any number of cells) within the range. The rest of cells are blank. In cell M19 (ie cell below the bottom right corner of the range), I need a excel function that returns the nearest (ie physical location) non blank cell value. I have searched the internet for weeks. The closest formula is the following (see below) but it is flawed as it returns zero if there are values in rows below the row of the nearest cell with non blank...and also zero if there is value in a column greater than the column of the nearest cell with non blank.

Closest formula so far:
INDEX(A1:M18,LARGE(IF(ISBLANK(A1:M18),"",ROW(A1:M18)),1)-ROW(A1:M18)+1,LARGE(IF(ISBLANK(A1:M18),"",COLUMN(A1:M18)),1)-COLUMN(A1:M18)+1).

And the function should be relative not absolute as the range can be extended..but the location of the formula remain same relative to the array size. (ie. always at below the right bottom cell).

NOTE: Ignore the special case where two non blank cells are the nearest. That will not happen.

View 5 Replies View Related

Return Value Based On Another Cells Value

Oct 3, 2006

I am setting up a spreadsheet for a Stock Broker. I need to have a cell produce a value dependent on the value of another cell. Specifically, I need the calculation cell to change depending on whether another cell has the letter A, S, Q, or M. I am calculating the value of investment income based on the Payment terms (A;annual, S;semiannual, Q;quarterly, M;monthly) So if for example Cell A7=A, then Cell C7 =”specified formula for Annual income”

View 5 Replies View Related

Return Value Based On Other Cells

Dec 15, 2007

The data attached shows the length of individual fixations (A4:A8) and whether the fixation was ON (=1) or OFF (=0) a specific target (C4:C8). I want to know how much time was spent ON target for each 250ms time bin (i.e. between 0-250ms, then 250-500ms etc).

My problem is that each fixation is a different length and may cross over the time bin boundaries. IF(AND(THEN ) works for the first few time bins but I get stuck once the first fixation is accounted for. I have filled the rest in manually so you can get an idea of what I want it to do.

View 3 Replies View Related

Return A Value From A Table Based On Several Other Cells

Mar 26, 2014

So I've been trying to set up a table.

The table is made of 4 columns, with several times the same values. Each column has a specific range of value. No possible combination can exist twice. Meaning I won't have two rows that are identical. It looks like :

A1@X
A1@Y
A1&X
A2&X
B3#K
B3#O
B3£K
B4£K
C5$P
C5$M
C5*P
C6*P

The user tells me the value he wants in the 3 first columns, and I want to tell him what's in the 4th one.

View 3 Replies View Related

Return Text Based On Another Cells Value

Jan 22, 2008

I have 5 options that I am designating as "Allocation Methods" for a number of line items. They are numbered 1-5, but i have custom formatted them so that they have text in the formatting. They are as follows;

Allocation Method
1 - Allocation per Hard Cost
2 - Allocation PSF of Proj. or Hotel
3 - Allocation per Loan
4 - Allocation per Parking Spaces
5 - Allocation for Park

I will allocate one of the above allocation methods to every line item in an allocation column by hardcoding 1 - 5 in a cell for each line item. What i cannot figure out (or figure out if it is even possible) is how, for instance, can I type in a 1 and it have it automatically formatted per number 1 above & then if I change my mind to method 2 and type 2 it will automatically format per number 2 above. I know I can do this by creating a reference column right beside by allocation column, but I would prefer not to use that method.

View 6 Replies View Related

Return X Characters Based On X Cells Having Whole Numbers Above Zero

Sep 14, 2007

IF there is a whole number in either column a, b or c, I need to have column e reflect that with the insertion of a / for each column that has a whole number. i.e.

Column - A - B - C - D - E
3 4 / /
5 6 9 / / /

I am attaching a copy of the spreadsheet showing the examples, I can't seem to get the function to work.

View 8 Replies View Related

VBA Code To Go Through Column Cells & Return Value Based On Cell Value

Jan 29, 2010

I have been stuck for about a week on trying to create a Case Select macro. I am a novice in using VBA, so I am not sure what I am doing right OR wrong. What I need the macro to do is go through all of the text in a column and if the text is one of the 50 states, I need it to return one specific value, and if it is anything other than one of the 50 states, it needs to return a different value in a column 5 over from the column with the states in it. I have changed the code MANY times and so far I haven't been able to get anything to work. Here's the gist of what I have been trying:

Sub usstates()
Dim R As Range, s As String
Set R = Sheets(1).Range("J1:J50000")
For i = 5 To R.Rows.Count
X = UCase(R.Cells(10, 1))
If X = "AL" Or X = "AZ" Or X = "AK" Or X = "AR" Or X = "CA" Then
R.Cells(i, 2) = "SC"
End If
Next i
End Sub.................

View 9 Replies View Related

Index Function - Data Identified Based On A List Of Account Numbers And Return This Data To A New Sheet

May 8, 2007

I have a multiple column spreadsheet (Call it- "Money") whereby I need the data identified based on a list of account numbers and return this data to a new sheet.

In "Money" I have:

IE; columns B, C respectively have cust #A100 & 20.00
columns E, F respectively have cust #B100 & 40.00
columns G,H respectively have cust #C100 & 60.00
Etc.

(above for illustration-there are 100 lines of data in these columns with varied account numbers and respective dollars)

So what I have now is a new sheet I have named "Control". I have listed all my account numbers like A100,B100 etc. in column A. These are the account numbers for ident purposes.

I need the data entered in "Money" identified by those columns B,E,G with respective amounts from C,F,H and based on the list I have in "Control" whereby in "Control" if A100 is listed in column A then the figure to be returned in column B is all the data bits found in all columns C,F,H from the entire sheet "Money". Tough to explain but ie below....

View 17 Replies View Related

Applying Function To Certain Cells Only Based On Another Column

Aug 17, 2014

Supposing you would like to find the median of numbers in column D, but only for rows that have the word "Jones" in column A? Is there a way to do this? Obviously I know I could do a sort and simply specify the range myself, but we're dealing with nearly 2000 rows and a LOT of different values in column A

It occurs to me that it would be even better if I could ask excel, in effect, to identify every separate text string in column a and then find the median of the corresponding numbers in column D. In other words I wouldn't have to type any strings from column A at all.

View 2 Replies View Related

Lookup Function Based On Multiple Cells

Jul 21, 2005

in the lookup function listed below, it only produces a result for the first exact macth. well, what if the data i am searching on could result in multiple results?
i would like advise on how to modify this formula to bring back the 2nd, 3rd, 4th, etc instance of a match in the lookup array.

the original formula , i found on this site, allows you to combine multiple cells to create a unique reference, and then search in another table containing columns of those combined cells, and results in the intersection of a row and column and that is the data you want returned ....
kind of like a hlookup, but you can use one or more cells to create the unique lookup, and bring back whatever column you want (where as a hlookup is limited to searching the left most column and bring back a column to the left)

here is the formula:

{=INDEX(data to retrieve,MATCH(cell1&cell2,table to find cell1 in&table to find cell2 in,0))}

"data to retrieve" is an array of one column containing the data you want to retrieve
"cell1&cell2" is a combination of cells to make the unique lookup (this could just be one cell if you wanted)
"table to find cell1 in&table to find cell2 in" is a table array to look in to find the look up value

View 9 Replies View Related

Sum Cells Based On Other Cells Value Using Right Function?

Jun 23, 2013

I have a tabel where in column A i have names, some of the names end with a certain text "text".
In column B I have values.

I'd like to sum all the values where corresponding names contain "text" at the end.

How to do it using 'right' function?

View 4 Replies View Related

Pivot Table Chaos: Blank Cells Return 0, Empty Cells Return Nothing

Jun 25, 2009

Hi, I desperately need help with a pivot-table and can't find anyone else who's ever had this problem...I have a very large healthcare data table which for simplicity I will describe as follows. In essence the first two columns respectively are (A) location and (B) month. Let's say the third column (C) is the number of cases of the disease kidpox treated in each health centre during that month. The fourth column (D) is the total number of cases of everything treated during that month in each clinic. The fifth column (E) is the proportion of cases of this disease over all consultations for each health centre and month, and the formula in E2 is .....

View 9 Replies View Related

Function Returns Value To Cell As Single - Function Is Defined To Return Double

May 14, 2013

Function Haversine has correct value in debugger but in cell it has the same value as Haversine2. Is this a known bug?

Public Function Haversine(lat1 As Double, long1 As Double, lat2 As Double, long2 As Double) As Double
Dim temp As Double

[Code]....

View 9 Replies View Related

IF Function (few Words Shown Based On Figures In Specific Cells)

May 17, 2009

I want to have a few words shown based on figures in specific cells. I not quite sure how to explain, but i will try my best:

A1 = 5
A2 = 0
A3 = 7

The function i am using looks something like this:-

=IF(A1<6,"Do I Have Sickness Self Cert?","Do I Have Doctor's Paper?")

However, by using this function, if the cell is empty it still shows the first wording when i need it to show lets say between 1 & 6 shows the first wording and more than 6 shows the second wording! If you know what i mean... I know what i want to do but cant really explain it very well.

Maybe it should look something like this but it does not work the way i am doing it.

=IF(E156>1<6,"Do I Have Sickness Self Cert?","Do I Have Doctor's Paper?")

View 5 Replies View Related

Excel 2010 :: Macro Based Search Function Using Data From 2 Cells

Mar 15, 2012

I have been using a macro to search and highlight customer addresses for me, however I have changed my worksheet and now have the addresses in two columns instead of one (D for the numbers, E for street names) for sorting purposes.

What I would like to do is either; find a way to search using data from 2 cells to get a result, or have multiple results highlight and popup.

Using: Excel 2010

Code:
Sub SEARCH_FUNCTION()
Set FoundCell = Sheets("Route").Cells.find(What:=Sheets("Intro").Range("G15"), LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
If Not FoundCell Is Nothing Then
With FoundCell

[Code] ...........

View 2 Replies View Related

Correct Syntax For Function To Find Average Based On Background Color Of Cells In Range

May 20, 2014

I'm working on a workbook that will track staffing patterns.

The workbook has three worksheets: Sheet1 "RCS", Sheet2 "HCT' and Sheet3 "Hidden". I've attached the workbook to this thread. The password for the form is "j".

On Sheet3 "Hidden" I have two tables that are set up to collect the SUM of columns on Sheets1 "RCS" and Sheet2 "HCT". I'm finding the SUM of each range by way of the background color. I've set up the following formulas and when the "data collection tables" are in the same worksheets as the original information, the formula's work perfectly:

The following functions are pulling data from Sheet1 "RCS" and placing them into a table in Sheet2 "Hidden"

[Code] ........

The following functions are pulling data from Sheet1 "RCS" and placing them into a table in Sheet2 "Hidden"

[Code] .......

I have two more functions that aren't working due to the fact that the source values are percentages and NOT plain numbers. The above functions work great for SUM but not for percentages. EXAMPLE--Let's say, 3 sub percentages it gives me the SUM of the 3 percentages (i.e. 85% + 100% + 100% = 285% instead of giving me 95%.

[Code] ........

How might I use the following functions to find the average of the source fields instead of the SUM?

View 7 Replies View Related

Return Multiple Results In Multiple Cells Based On Criteria In Yet Another Cell?

Feb 1, 2012

Worksheet 1: In column A I have a people's initials. In coumn B I have text boxes with miscellaneous text. (The same person could have multiple rows within this sheet.)

e.g.
AAA blue
BBB orange
AAA round
CCC smelly
AAA elongated

Worksheet 2 I want to show:
A2 = initials, B2 = first text box associated with that person, C2 = second text box (different row) associated with that person (if applicable), D2 = third text box (different row) associated with that person (if applicable), etc.

e.g.
AAA blue round elongated
BBB orange
CCC smelly

View 3 Replies View Related

Using If Function To Pull Data From One Cell Based On Data From Merged Cells

Jul 24, 2014

Looking for a formula to accomplish the following:

I'm trying to populate cell A31 on a worksheet titled "VolumeTotals" with the data in Cell E23 from a worksheet titled "CurrentCustomers" if the merged cells F3-F22 on worksheet "CurrentCustomers" are equal to the word "Contract".

View 6 Replies View Related

Function Won't Return Value

Dec 29, 2006

I'm trying to get a "simple" function to return a number and not the #NAME?error!

I'm writing the following vba code. It's located in the sheet1 vba code area.

On the spreadsheet itself, on sheet1, column C, there is data from row 1 down to row 55. I have tried formatting the Column as General, text,etc.

Function Asset() As String
Asset = Range("C1").End(xlDown).Row
End Function

When I type into the spreadsheet =Asset() , I get the #NAME? instead of the number 55.
When I step through in debug mode, Asset shows Asset="55" , but my function doesn't return it!

View 9 Replies View Related

Using Function To Return A Value

Oct 21, 2012

I am trying to use a function to look at the value in one cell and return a value to the cell with the functional equation. I think I use the "IF" Function. But it is a little more complicated than I can do. In my sheet, there is a number in D3. I want to create an equation in D4 that evaluates the value in D3. If D3 is between 0 and 100, I want the equation in D4 to return the value 1; If D3 is greater than 100 but less than or equal to 200, I want D4 value to be 2; if D3 greater than 200 but less than or equal to 300, D4 return 4. I would like this to continue in increments of 100 until D4 equals 10.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved