LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 279
Default Mapping strings to integers

This is the inverse need of my question "Mapping integers to strings" in
<http://groups.google.com/g/7097feea/...7e69c03bea746b
4b
I want to map English language month names to month numbers in 1..12.

So far, I have
=VLOOKUP($AL9,{"April",4;"August",8;"December",12; "February",2;"January"
,1;"July",7;"June",6;"March",3;"May",5;"November", 11;"October",10;"Septe
mber",9},2,FALSE)

=HLOOKUP($AL9,{"April","August","December","Februa ry","January","July","
June","March","May","November","October","Septembe r";4,8,12,2,1,7,6,3,5,
11,10,9},2,FALSE)
and

=MATCH($AL9,{"January","February","March","April", "May","June","July","A
ugust","September","October","November","December" },0)

AL9 contains a month name.

These formulas seem inappropriately complicated for mapping month names
to month numbers, but are general purpose for mapping arbitrary sets of
strings to numbers.

Is there a simpler MonthNumber formula, I have missed?

I now answer my own question: =MONTH("1-" & $AL9 & "-1900")
;)
--
Walter Briscoe
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mapping integers to strings Walter Briscoe Excel Worksheet Functions 6 June 25th 13 01:19 PM
find and replace numeric strings in larger text strings Mr Molio Excel Worksheet Functions 8 November 9th 11 05:17 PM
How to find number of pairs of strings from list of strings? greg_overholt Excel Worksheet Functions 5 January 27th 06 10:42 PM
A list of Consecutive Integers, can I search for missing integers CM Excel Worksheet Functions 4 September 2nd 05 06:38 PM


All times are GMT +1. The time now is 10:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"