Using IF Function To Determine Value?

Jan 6, 2014

I would like to choose an option (C, Q, T) and get a result in 1 column.

In other words, if I type C in H6, I must get a different result in I6 as opposed to if I choose Q or T in the same column. However if I leave it blank I should have nothing or a 0 in I6.

In the attachment above you will see that I gave a sum for C (A3), Q (A4) and T (A5). The sum for each one is broken down into a percentage rate and a flat rate.

These rates are dependent on the initial amount entered into G6. C, Q, T stand for Cash, Cheques, Transfers. The form of transaction determines the % and flate rate to be charged.

View 11 Replies


ADVERTISEMENT

Function/Formula To Determine If Workbook Open

May 16, 2008

how do you set a return value for a function in VBA? I've looked at examples of functions and I don't understand.

All I want to do is call a function to see if a workbook is open and have it return true or false. Here is the code I have, but it won't let me use go "Return isOpen" at the end like VB would! The IDE complains.

Function IsWorkBookOpen(ByVal name As String) As Boolean
Dim wBook As Workbook
Dim isOpen As Boolean

wBook = Workbooks(name)

If wBook Is Nothing Then
isOpen = False
Else
isOpen = True
End If

'I can't reutrn the value of is open?
Return isOpen

End Function

I've noticed other VBA functions I've looked at don't use "Return"....how does does the function return a value then?

View 3 Replies View Related

Function For Determine If Cell Has 'mingled Bold Text'

Jan 11, 2010

I have the following formula (taken from the web) in my spreadsheet which let me know if a cell have bold text or not. But when the cell has 'mingled' text, i.e. only partly bold, he gave a #VALUE error.

View 10 Replies View Related

Function/Formula To Determine If Row/Column Hidden/Showing

Apr 2, 2008

In the enclosed wb you will find 2 custom functions.

The IsRowHidden Checks weather row 3 is hidden and works fine.

However, IsColHidden does not change from False to True upon hiding col. C.

What did I do wrong !?

View 9 Replies View Related

Determine Last Used Row

Dec 12, 2007

i need to have this information entered in the row below each time which may or maynot be empty. i need a message box with error handling to ask if the user wants to enter more products or finish and another message box if the entries (which start at cell B4) go past B10 that they have to exit and start a new sheet. I have put the code below and attached the workbook so it may be of use to others

Option Explicit

Sub Locate(Name As String, Data As Range)
Dim rngFind As Range
Dim strFirstFind As String
With Data
Set rngFind = .Find(Name, LookIn:=xlValues, lookat:=xlPart)
If Not rngFind Is Nothing Then
strFirstFind = rngFind.Address
Do
If rngFind.Row > 1 Then
ListBox1.AddItem rngFind.Value
End If....................

View 5 Replies View Related

Determine Used Column And End Of Row

Sep 14, 2012

Right now in my code I'm using the below section to determine the column in which to search for dupes, and the last column of data for that range. However, I make the user select only part or one column through IF statements above, so there's no need for the user to input this information. I'd like to replace the choice part with and automated routine that determines the DupeCol from the column section selected, and determines the rowend from the last used cell to the right in the rows in that column selection. But I don't know how to do that and keep the values as strings.

VB:
Dim RowEnd As String, DupeCol As String
Dim LastRow As Long
DupeCol = InputBox("Type in the letter of the column you want to look for duplicates in.", "Fill in the Info")
RowEnd = InputBox("Type in the letter of the last column you want colored.", "Fill in the Info")

View 4 Replies View Related

Determine Max Value Of Parabolas?

Jan 14, 2014

I have a big serie of charts (parabolas - open down) that i need to find the max value.

View 8 Replies View Related

Determine By How Many White

Mar 21, 2006

I have a spreadsheet with Ethnicity (White, African American, hispanic,
Asian, other) in column A and Time (hh:mm:ss) in column B.

I trying to determine by how many White, for example, have spent less than 5
hours, >5 hrs but less than 10 hr, etc.

My plan is to make a chart of the data.
I've been looking at sumproduct and COUNTIF but I can't quite figure it out.

View 10 Replies View Related

Determine Largest Value

Mar 26, 2009

I'm working with box quantities and would like to get a formula that would take the box quantity and return the largest value based on some parameters. Here are my parameters:

Box Quantity

- 375 pieces

Break down options

2 - 187.5 pieces
3 - 125 pieces
4 - 93.75 pieces
5 - 75 pieces


Obviously options 2 and 4 are no good as I can only work with even break downs. This leaves me with either 3 or 4 and because I want the largest, I would choose number 3. What I need is help on a formula that will take the value of the box quantity and return the largest whole number. I think for the time being I would like to leave the break down between 2 and 5 as well.

View 5 Replies View Related

Determine Whether Value Is Within Certain Ranges

Dec 13, 2011

What do I do if I want to determine whether an input is within a specified range, and then for there to be an output of a certain value from another cell?

For example, with tax brackets: if income (D) falls within B and C, return value A(from a separate column)?

Here is the data I have:

Column A

"Formula referencing D1"
"Formula referencing D1"
"Formula referencing D1"
"Formula referencing D1"
"Formula referencing D1"

[code]....

Column D, cell D1 is where you would input a number (income) Column E, cell E1 is where I want the output value.

Basically, what I would like is a formula to put into column E that will do two things. First, to determine if the value in D1 is within either (B1-C1, B2-C2, B3-C3, B4-C4, or B5-C5). Second, to then output the value of either A1, A2, A3, A4, or A5, for each respective range.

View 9 Replies View Related

UDF To Determine Changes In A Cell

Feb 2, 2012

I want to write a function that goes out and reads a cell, waits a few seconds, then reads the cell again, since it is constantly changing. Then report back the difference between the two readings of the same cell. The following code does not work since t0 and t1 always come back the same value.

Code:
Function ReadTime(t)
t0 = t
DoEvents
Application.wait Now() + TimeValue("00:00:15")
t1 = t
ReadTime = t1 - t0
End Function

View 3 Replies View Related

Formula To Determine Age

May 16, 2007

formula I can use to determine age between date of birth (in one cell) and an event date (in another cell)., i.e. birthdate 3/15/2000 with an event date of 3/2/2007.

View 9 Replies View Related

Need To Determine The Last Row In A Range

Apr 5, 2009

I am having a bit of amnesia right now, but I know there are some smart cookies out there who can do this in a second or two.

I have a certain range in a worksheet (D6:D27). I need to find the first blank row, or the last row with data +1. I would like a worksheet function of some sort that might be used like this

=LastRow(D6:D27)

The result would be row 10 (the first blank row).

I have been searching for the past hour and just can not get anything to work right. I have tried many different suggestions, but I still draw a blank.

View 9 Replies View Related

Determine Value Of TextBox

Nov 8, 2006

i have this code behind a command button in a userform

Private Sub cmdCalculate_Click()
If Me.txtLength.Value > "6.021" Then
lbM2.Caption = Val(txtHeight) * Val(txtLength)
End If
End Sub

the calculations work fine up till i enter anything over 9.999 in the textbox called "txtLength" Can any one see why this will not perform calculations when the entry is more than 9.999 in text box "txtLength"? i tried replacing the label control with a textbox!

View 4 Replies View Related

Determine If A Number Is Even Or Odd

Jan 20, 2007

Determine If A Number Is Even Or Odd. i would like to Determine If A Number Is Even Or Odd...?

View 3 Replies View Related

Determine An Investment Max Value

Feb 14, 2007

I want to easily determine the max value of the stocks I own by only changing the daily value but i cannot bypass the circular reference problem. Example:

Stock|Today's Value| Max Value
A | 1 | 1
B | 3 | 3

Tomorrow i'm going to change today's value and my goal is that the max value remains unaltered if today's value is smaller. like this:

Stock|Today's Value| Max Value
A | 2 | 2
B | 1 | 3

View 4 Replies View Related

Determine If Value Is Between 2 Values

Dec 4, 2007

at present i have the following code that does as intended.


If number < pr1 Then
number = 0
End If

how would i alter this so that it changes the 'number' if number is between pr1 and another number pr2?

View 9 Replies View Related

Determine Cell Value Or N/A

Dec 20, 2007

I am working on a spreadsheet where individuals must enter a value between 1 - 4 or n/a. I would like to include a formula for each question where if they enter a value between 1-4, this scores 1 and if they enter n/a this scores 0. Does anyone know a simple formula I could use, I have tried IF formulas but keep getting muddled.

View 2 Replies View Related

Determine Which Textbox Has Lowest Value?

Jun 23, 2014

I have 4 TextBox on a UserForm. First three to enter value and the last one to return the lowest value entered in to the first Three TextBox. How to determine the lowest value and show it on last TextBox.

View 2 Replies View Related

Determine Total Goals

Feb 21, 2009

how can i get excel to read column c and return the answer into column f i have scores in column c that look like eg. 2-2 what i need excel to do is count the goals
in the example obviously 4 and then in column f if its over 2.5 return the value over but if its under 2.5 it returns under is this possible please given the format of column c?

View 14 Replies View Related

Use Two Fields To Determine Lookup Value?

Jun 9, 2009

I'm sure it is possible to solve this with an array, despite all my efforts having produced nothing so far. Attached is an example workbook. On the 'Data' sheet, every month the data will change and I need to fill in column A, with the approriate Name from the 'Map' sheet. Is this possible using an array?

View 3 Replies View Related

Determine Position/order Of Tab(s)

Feb 11, 2010

I'm am trying to find some way to determine if a particular tab falls before/after/between other tabs in a workbook. For example, if I have a tab "Top" and a tab "Bottom", I want to be able to determine if tab X is between them.

View 14 Replies View Related

Determine After Filter Row Numbers

Apr 3, 2014

Is there a way to automatically determine the final row number showing after a manual filter operation? Or maybe getting a list of the row numbers showing on the screen.

The project requires a macro that loops through only the rows of a filtered list, not all of the rows in the worksheet.

View 3 Replies View Related

Determine Page Number

Apr 29, 2008

Is it possible to programmatically determine the page number on which a specific cell will print?

View 14 Replies View Related

Determine If Workbook Is Open

Oct 19, 2008

If I have a multiple workbooks open and I want to determine if a workbook is open for example "Test 1.xls", how would I do that. I want it to msgbox once to say "open" if open or msgbox "not open" if not open.

View 2 Replies View Related

Determine And Write To The Last Row Of A Worksheet

Sep 21, 2009

I managed to write my script with pretty much the info I could find on the forums (yes!) but I need to write my data to the last row. Columns A - D of the last row will be populated with the content of my variables. This little snipped gives me the first empty row:

View 5 Replies View Related

How To Determine What Cell Was Selected

Nov 2, 2009

Can anyone help me in finding how to write the command in VBA to determine what Cell was selected in a worksheet? The objective is to know what Cell has been selected by double click event to pop up a userform with a calendar from which the user can select the date. I am looking at making it dynamic so I do not select a particular range.

Can this be achieved? I guess yes, but how?

View 9 Replies View Related

Determine If Cell Contains Any Text In VBA

Feb 4, 2010

I have tried searching for a way for VBA to recognise in VBA if a cell contains any text, but most of my searches respond to specific cases for specific characters in a string

Basically, I'm just looking for the correct way to word a string of code that if it detects any text in column B (col 2 ) then it should not do anything, else it should cut the value in col 2 and paste it in col 8

View 8 Replies View Related

Determine Row Number Of Last Value In Column

May 15, 2009

Trying to do a simple workbook here, with hopefully no macros/VB script.

Essentially, I want a cell to display the row number (-1 to take into account the heading) which has the last value contained in it.

The workbook is a list of users that have signed up in 1 month, and is distributed to staff for a particular reason.

The cell I'm trying to create is part of a 'stats' section.

View 7 Replies View Related

VBA Determine Which Charts Are Selected

Dec 17, 2011

I have a macro which formats charts. It takes a user selected chart and formats it.

I would like to allow the user to select many charts and process them all at once (instead of just one at a time).

The problem is that when I have X charts selected in Excel, the Selection object assumes the "ChartObjects" type which includes all charts in the worksheet and not only those which are selected!

If I do "Selection.Count" it will count all charts (selected or not) and if I do "Selection.Item(x).Name" I can access any chart on the worksheet and not only those which are selected.

Questions:

1. Is there anyway to determine which charts are selected by the user? Either using the selection object or any other method?

2. When I select multiple objects (chart and non-charts), the selection object assumes the "DrawingObjects" type, which when counted returns the correct number of selected objects. However when I try to access them via "Selection.Item(x)" I again can access all DrawingObjects in the worksheet. Is there anyway to determine which drawing objects are selected? And access them (so I can determine whether they are charts)?

View 9 Replies View Related







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