Hello,
I have a column of numeric values and would like in another column to display a text character based on the value of that number.
For example if number is between 0 and 12 in column A (cell A1) display D in column B (cell B1). Else, if the number is between 13 and 26 display C instead.
Does anyone know how I would go about doing this? I havn't got any experience of using VB so if thats needed posting the code would be great.
Thanks for your time,
Martin
Maybe
VBA Noob=IF(A1="","",LOOKUP(A1,{0,13},{"D","C"}))
_________________________________________
![]()
![]()
Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters
Please remember to wrap code.
Forum Rules
Please add to your signature if you found this link helpful. Excel links !!!
Good morning Martin84
Is your data ever going to return a minus number, or a number greater than 26? If so, this formula will just return a blank instead of an error :
=IF(AND(A1>=0,A1<=12)=TRUE,"D",IF(AND(A1>=13,A1<=26)=TRUE,"C",""))
HTH
DominicB
Now available : Ultimate Add-In 2007
Integrates directly into the Office Excel Ribbon
Download Ultimate Add-In v1.52 from www.dom-and-lis.co.uk
90+ Utilities, 200+ Sub utilities last updated 25th April 2008
Free!!
Hi, no it wont run into negative numbers. Just found the data I am working with is:
(Column A) (Column B output)
6-8 F
16 - 18 C
23 - 26 A
Just dont know how to put this into Excel
Thanks
F
C
A
is the column B output i want, the spaces got cut out when I posted
Hi Martin, try this formula based on your new info:
Code:=IF(AND(A1>=6,A1<=8),"F",IF(AND(A1>=16,A1<=18),"C",IF(AND(A1>=23,A1<=26),"A","")))
Thanks pjoaquin, that worked fine.
Hi, I have a spreadsheet that applies the letters either A*, A, B, C to a cell depending on the numeric value of the cell next to it (see attached). What I need to do is to work out an amount showing the percentage of say B entries from all the entries in the 'Grades' column. I have no idea how to do this, can someone please find the time to help? A working formula would be great.
Thanks,
Martin
In column D, get rid of the colons, and change "A*" to "A~*"
In E6 and copy down, =COUNTIF($C$5:$C$34, D6)/ROWS($C$5:$C$34)
Code:-D- --------------------E--------------------- 6 A~* =COUNTIF($C$5:$C$34, D6)/ROWS($C$5:$C$34) 7 A =COUNTIF($C$5:$C$34, D7)/ROWS($C$5:$C$34) 8 B =COUNTIF($C$5:$C$34, D8)/ROWS($C$5:$C$34) 9 C =COUNTIF($C$5:$C$34, D9)/ROWS($C$5:$C$34) 10 D =COUNTIF($C$5:$C$34, D10)/ROWS($C$5:$C$34)Code:-D- -E- 6 A~* 13% 7 A 40% 8 B 43% 9 C 3% 10 D 0%
Thanks, for the value of 'A' results that gave me the number 0.4 which I assume is 40 %. Is there any way to make this read '40' or '40 %' instead, or have another calculation to translate it?
Thanks
Format > Cells > Number > Percentage, and pick the number of decimal places you want.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks